Index: /XIOS/trunk/Doxyfile
===================================================================
--- /XIOS/trunk/Doxyfile	(revision 306)
+++ /XIOS/trunk/Doxyfile	(revision 306)
@@ -0,0 +1,1725 @@
+# Doxyfile 1.7.4
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# 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 (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# 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 quotes) that should identify the project.
+
+PROJECT_NAME           = XMLIOSERVER
+
+# 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         = 0.4
+
+# 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          = "Serveur d'EntrÃ©es/Sorties parallÃšles"
+
+# 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 cause performance problems for the file system.
+
+CREATE_SUBDIRS         = 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. 
+# 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 (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 (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.
+
+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" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         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 
+# description.
+
+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 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# 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
+
+# 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 
+# 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 comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = 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 (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.
+
+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.
+
+TAB_SIZE               = 8
+
+# 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 
+# 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 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.
+
+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, 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.
+
+BUILTIN_STL_SUPPORT    = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = 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 (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 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# 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).
+
+INLINE_GROUPED_CLASSES = NO
+
+# 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.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# 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
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# 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.
+
+EXTRACT_PRIVATE        = YES
+
+# 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.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# 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 namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = 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 (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 (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 (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 (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 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = 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 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 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 (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 (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 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 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 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 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.
+
+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.
+
+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.
+
+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.
+
+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.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# 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 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = 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 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. 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 by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = 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 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
+
+# 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)
+
+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 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, 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 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 \
+                         *.hpp \
+                         *.conf
+
+# 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 
+# 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.
+
+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.
+
+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, 
+# AClass::ANamespace, ANamespace::*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.
+
+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. 
+# 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 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 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 and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# 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.
+
+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.
+
+REFERENCES_RELATION    = 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 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 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.
+
+ALPHABETICAL_INDEX     = 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 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. 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). 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 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.
+
+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.
+
+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 NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = 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
+
+# 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.
+
+GENERATE_DOCSET        = NO
+
+# 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"
+
+# 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
+
+# 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.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# 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
+
+# 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.
+
+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
+
+# 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 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.
+
+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.
+
+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 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# 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.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# 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 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
+
+# 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
+
+# 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. 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 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 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 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
+
+# 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 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
+
+#---------------------------------------------------------------------------
+# 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. 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. 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. 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.
+
+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, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# 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, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+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.
+
+LATEX_BATCHMODE        = NO
+
+# 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 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
+
+#---------------------------------------------------------------------------
+# 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. 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.
+
+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 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.
+
+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. 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 (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# 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.
+
+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. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# 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 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.
+
+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.
+
+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.
+
+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.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# 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 (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.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# 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.
+
+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::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.
+
+EXTERNAL_GROUPS        = YES
+
+# 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
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# 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 
+# default search path.
+
+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, 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 (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
+
+# 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 of the font of dot graphs. 
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# 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 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 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 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = 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 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 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 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 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, 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. Possible values are svg, png, jpg, or gif. 
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# 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.
+
+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 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+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).
+
+DOT_TRANSPARENT        = NO
+
+# 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 (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 (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-X64_TITANE.env
===================================================================
--- /XIOS/trunk/arch/arch-X64_TITANE.env	(revision 306)
+++ /XIOS/trunk/arch/arch-X64_TITANE.env	(revision 306)
@@ -0,0 +1,10 @@
+module unload netcdf
+module unload hdf5
+export HDF5_INC_DIR=$WORKDIR/hdf5/include
+export HDF5_LIB_DIR=$WORKDIR/hdf5/lib
+
+export NETCDF_INC_DIR=$WORKDIR/netcdf4/include
+export NETCDF_LIB_DIR=$WORKDIR/netcdf4/lib
+
+#module unload phdf5
+#module load phdf5/1.8.6
Index: /XIOS/trunk/arch/arch-X64_TITANE.fcm
===================================================================
--- /XIOS/trunk/arch/arch-X64_TITANE.fcm	(revision 306)
+++ /XIOS/trunk/arch/arch-X64_TITANE.fcm	(revision 306)
@@ -0,0 +1,20 @@
+################################################################################
+###################        Projet xios - xmlioserver       #####################
+################################################################################
+
+%CCOMPILER      mpicc
+%FCOMPILER      mpif90
+%LINKER         mpif90  -nofor-main
+
+%BASE_CFLAGS    -ansi -DXIOS_LIBRARY -DNONE -DXIOS_LIBRARY -diag-disable 1125 -diag-disable 279
+%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
+%DEV_CFLAGS     -D XIOS_DEBUG -g -traceback
+%DEBUG_CFLAGS   -D XIOS_DEBUG -g -traceback -fno-inline
+
+%BASE_FFLAGS    -DXIOS_LIBRARY -DXIOS_LIBRARY 
+%PROD_FFLAGS    -O3
+%DEV_FFLAGS     -DXIOS_DEBUG -g -traceback
+%DEBUG_FFLAGS   -DXIOS_DEBUG -g -traceback
+
+%BASE_INC       -D NONE
+%BASE_LD        -lstdc++
Index: /XIOS/trunk/arch/arch-X64_TITANE.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_TITANE.path	(revision 306)
+++ /XIOS/trunk/arch/arch-X64_TITANE.path	(revision 306)
@@ -0,0 +1,15 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-L $HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
+
+OASIS_INCDIR="-I$WORKDIR/NEMO_COUPLE/prism/X64/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$WORKDIR/NEMO_COUPLE/prism/X64/lib"
+OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
Index: /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.fcm
===================================================================
--- /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.fcm	(revision 306)
+++ /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.fcm	(revision 306)
@@ -0,0 +1,20 @@
+################################################################################
+###################        Projet xios - xmlioserver       #####################
+################################################################################
+
+%CCOMPILER      g++
+%FCOMPILER      gfortran
+%LINKER         /usr/lib/openmpi/bin/mpif90
+
+%NO_WARN        -W -Wall -Wno-unused-parameter -Wno-long-long -Wno-deprecated
+%BASE_CFLAGS    -ansi -D XIOS_LIBRARY -DNONE -D XIOS_LIBRARY %NO_WARN
+%PROD_CFLAGS    -O3
+%DEV_CFLAGS     -D XIOS_DEBUG -g
+%DEBUG_CFLAGS   -D XIOS_DEBUG -g
+
+%BASE_FFLAGS    -D XIOS_LIBRARY -DNONE -D XIOS_LIBRARY
+%PROD_FFLAGS    -O3
+%DEV_FFLAGS     -D XIOS_DEBUG -g
+%DEBUG_FFLAGS   -D XIOS_DEBUG -g
+
+%BASE_LD        -lstdc++       
Index: /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.path
===================================================================
--- /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.path	(revision 306)
+++ /XIOS/trunk/arch/arch-X86_LOCGNU_FEDORA.path	(revision 306)
@@ -0,0 +1,11 @@
+NETCDF_INCDIR="-I /work/dev_rv/extra/netcdf4/include"
+NETCDF_LIBDIR="-L /work/dev_rv/extra/netcdf4/lib"
+NETCDF_LIB="-lnetcdf"
+
+MPI_INCDIR="-I /usr/include/openmpi-i386"
+MPI_LIBDIR="-L /usr/lib/openmpi/lib"
+MPI_LIB="-lmpi -lmpi_cxx"
+
+HDF5_INCDIR="-I /work/dev_rv/extra/hdf5/include"
+HDF5_LIBDIR="-L /work/dev_rv/extra/hdf5/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz"
Index: /XIOS/trunk/arch/arch-X86_LOCINTEL_FEDORA.fcm
===================================================================
--- /XIOS/trunk/arch/arch-X86_LOCINTEL_FEDORA.fcm	(revision 306)
+++ /XIOS/trunk/arch/arch-X86_LOCINTEL_FEDORA.fcm	(revision 306)
@@ -0,0 +1,20 @@
+################################################################################
+###################        Projet xios - xmlioserver       #####################
+################################################################################
+
+%CCOMPILER      icc
+%FCOMPILER      ifort
+%LINKER         /usr/lib/openmpi/bin/mpif90
+
+%BASE_CFLAGS    -ansi -D XIOS_LIBRARY -DNONE -D XIOS_LIBRARY -diag-disable 1125
+%PROD_CFLAGS    -O3
+%DEV_CFLAGS     -D XIOS_DEBUG -g
+%DEBUG_CFLAGS   -D XIOS_DEBUG -g
+
+%BASE_FFLAGS    -D XIOS_LIBRARY -DNONE -D XIOS_LIBRARY
+%PROD_FFLAGS    -O3
+%DEV_FFLAGS     -D XIOS_DEBUG -g
+%DEBUG_FFLAGS   -D XIOS_DEBUG -g
+
+%BASE_INC       -I /usr/include/openmpi-i386
+%BASE_LD        -lstdc++ -lifcore -lintlc     
Index: /XIOS/trunk/bld.cfg
===================================================================
--- /XIOS/trunk/bld.cfg	(revision 306)
+++ /XIOS/trunk/bld.cfg	(revision 306)
@@ -0,0 +1,48 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc arch.fcm
+inc config.fcm
+
+%CFLAGS           %BASE_CFLAGS %COMPIL_CFLAGS
+%FFLAGS           %BASE_FFLAGS %COMPIL_FFLAGS
+%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
+
+
+search_src           true
+src::zzz .
+bld::lib xios
+bld::target libxios.a
+#bld::target main_server.exe test_xios.exe 
+bld::target server_main.exe test_cs.exe 
+bld::exe_dep
+
+bld::tool::cc        %CCOMPILER
+bld::tool::fc        %FCOMPILER
+bld::tool::cppflags  %BASE_INC -I${PWD}/extern/boost/include -I${PWD}/extern/rapidxml/include -I/usr/include
+bld::tool::ld        %LINKER
+bld::tool::ldflags   %LD_FLAGS 
+bld::tool::cflags    %CFLAGS %CBASE_INC -I${PWD}/extern/boost/include -I${PWD}/extern/rapidxml/include -I/usr/include
+bld::tool::fflags    %FFLAGS %FBASE_INC -I/usr/include
+bld::tool::cppkeys   %CPP_KEY
+bld::tool::fppkeys   %CPP_KEY
+
+# Pre-process code before analysing dependencies
+bld::pp              false
+bld::excl_dep        use::mod_prism_get_comm
+bld::excl_dep        use::mod_prism_get_localcomm_proto
+bld::excl_dep        use::mod_prism_proto
+bld::excl_dep        inc::mpif.h
Index: /XIOS/trunk/make_xios
===================================================================
--- /XIOS/trunk/make_xios	(revision 306)
+++ /XIOS/trunk/make_xios	(revision 306)
@@ -0,0 +1,130 @@
+#!/bin/bash
+
+install_dir=$PWD
+compil_full="false"
+use_oasis="false"
+
+# Traitement de la ligne de commande
+while (($# > 0))
+   do
+      case $1 in
+         "-h")
+            # A modifier
+            exit;;
+
+         "--prod")  compil_mode="prod"  ; shift ;;
+         "--dev")   compil_mode="dev"   ; shift ;;
+         "--debug") compil_mode="debug" ; shift ;;
+         "--arch")  arch=$2     ; shift ; shift ;;
+         "--full")  compil_full="true"  ; shift ; shift ;;
+         "--use_oasis")  use_oasis="true"  ; shift  ;;
+         "--doc")   doc="true"          ; shift ;;
+         *)         code="$1"           ; shift ;;
+      esac
+   done
+
+# VÃ©rification de la prÃ©sence d'un identifiant d'architecture.
+
+###############################################################
+# lecture des chemins propres à l'architecture de la machine #
+#           et configuration de l'environnement              #
+###############################################################
+
+rm -f .void_file
+echo > .void_file
+rm -rf .void_dir
+mkdir .void_dir
+
+if [[ !(-z $arch) ]]
+   then
+      rm -f  $install_dir/arch.path
+      rm -f  $install_dir/arch.fcm
+      rm -f  $install_dir/arch.env
+      ln -s  $install_dir/arch/arch-${arch}.path $install_dir/arch.path
+      ln -s  $install_dir/arch/arch-${arch}.fcm  $install_dir/arch.fcm
+
+      if test -f $install_dir/arch/arch-${arch}.env
+      then
+        ln -s $install_dir/arch/arch-${arch}.env arch.env
+      else
+        ln -s $install_dir/.void_file arch.env
+      fi
+
+      source $install_dir/arch.env
+      source $install_dir/arch.path
+  else
+      echo "Veuillez definir une architecture cible !"
+      exit 1
+fi
+
+# VÃ©rification de la prÃ©sence d'un mode de compilation.
+
+if [[ "$compil_mode" == "prod" ]]
+   then
+      COMPIL_CFLAGS="%PROD_CFLAGS"
+      COMPIL_FFLAGS="%PROD_FFLAGS"
+elif [[ "$compil_mode" == "dev" ]]
+   then 
+      COMPIL_CFLAGS="%DEV_CFLAGS"
+      COMPIL_FFLAGS="%DEV_FFLAGS"
+elif [[ "$compil_mode" == "debug" ]]
+   then
+      COMPIL_CFLAGS="%DEBUG_CFLAGS"
+      COMPIL_FFLAGS="%DEBUG_FFLAGS"
+else 
+   echo "Veuillez definir un mode de compilation [debug|dev|prod] !"
+   exit 1
+fi
+
+if [[ "$use_oasis" == "true" ]]
+   then
+   XMLIO_FINCDIR="$OASIS_INCDIR $XMLIO_FINCDIR"
+   XMLIO_LIB="$OASIS_LIBDIR $OASIS_LIB $XMLIO_LIB"
+   XMLIO_CPPKEY="$XMLIO_CPPKEY USE_OASIS"
+else
+  fcm build
+fi 
+XMLIO_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR"
+XMLIO_FINCDIR="$XMLIO_FINCDIR $MPI_INCDIR"
+
+XMLIO_LIB="$XMLIO_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       $XMLIO_CPPKEY"  >> config.fcm
+
+echo "%CBASE_INC     $XMLIO_CINCDIR" >> config.fcm     
+echo "%FBASE_INC     $XMLIO_FINCDIR" >> config.fcm
+echo "%ARCH_LD       $XMLIO_LIB" >> config.fcm 
+
+echo "=> Activation du mode "$compil_mode" pour la distribution sous l'architecture \""$arch"\" !"
+
+# CrÃ©ation de la documentation doxygen.
+if [[ !(-z $doc) ]]
+   then
+      echo -e "- CrÃ©ation de la documentation de code doxygen (dÃ©sactivÃ©e)..."
+      #doxygen -s
+fi
+
+make_dir=$PWD
+
+export PATH=$PWD/tools/FCM/bin:$PATH
+
+#$make_dir/tools/preprocess_cpp $make_dir/src/xmlio/iface/interface.cpp      $make_dir/src/xmlio/iface/interface.cpp.in
+#$make_dir/tools/preprocess_f03 $make_dir/src/xmlio/fortran/ixmlioserver.f90 $make_dir/src/xmlio/fortran/ixmlioserver.f03.in
+
+if [[ "$compil_full" == "true" ]]
+   then
+   fcm build -f
+else
+  fcm build
+fi
+
+
+if [[ $? == 0 ]]
+  then
+#    cd $WORKDIR/XMLIO_NEMO_COUPLE/modeles/NEMO/WORK
+    cd $WORKDIR/XMLIO_NEMO/modeles/NEMO/WORK
+#    make
+fi
Index: /XIOS/trunk/src/array.hpp
===================================================================
--- /XIOS/trunk/src/array.hpp	(revision 306)
+++ /XIOS/trunk/src/array.hpp	(revision 306)
@@ -0,0 +1,82 @@
+#ifndef __XMLIO_CArray__
+#define __XMLIO_CArray__
+
+/// boost headers ///
+#include <boost/cstdint.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/multi_array.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+
+namespace xmlioserver
+{
+   template<size_t numDims>
+   detail::multi_array::extent_gen<numDims> getExtentNull(void) { return getExtentNull<numDims-1>()[0];}
+   
+   template<>
+   detail::multi_array::extent_gen<1> getExtentNull<1>(void) { return extents[0]; }
+
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <typename ValueType, StdSize  NumDims,
+             typename Allocator = std::allocator<ValueType> >
+      class CArray
+         : public boost::multi_array<ValueType, NumDims, Allocator>
+   {
+         /// DÃ©finition de type ///
+         typedef boost::multi_array<ValueType, NumDims, Allocator> SuperClass;
+
+      public:
+
+         typedef ValueType ValType;
+
+         /// Constructeurs ///
+         template <typename ExtentList>
+            explicit CArray(const ExtentList & sizes);
+
+         explicit CArray();
+
+         template <typename ExtentList>
+            CArray(const ExtentList & sizes, const boost::general_storage_order<NumDims> & store);
+
+         CArray(const CArray & array);       // NEVER IMPLEMENTED.
+         CArray(const CArray * const array); // NEVER IMPLEMENTED.
+
+      public:
+
+         /// Flux ///
+         template <typename U, StdSize V, typename W>
+            friend StdOStream & operator << 
+                  (StdOStream & os, const CArray<U, V, W> & array);
+
+         template <typename U, StdSize V, typename W>
+            friend StdIStream & operator >> 
+                  (StdIStream & is, CArray<U, V, W> & array);
+
+      public:
+
+         void toBinary  (StdOStream & os) const;
+         void fromBinary(StdIStream & is);
+
+         size_t getSize(void) const ;
+         bool toBuffer  (CBufferOut& buffer) const;
+         bool fromBuffer(CBufferIn& buffer);
+
+
+         /// Destructeur ///
+         virtual ~CArray(void);
+
+   }; // class CArray
+   
+
+   ///---------------------------------------------------------------
+
+} // namespace xmlioserver
+
+#include "array_impl.hpp"
+#include "array_mac.hpp"
+
+#endif // __XMLIO_CArray__
Index: /XIOS/trunk/src/array_impl.hpp
===================================================================
--- /XIOS/trunk/src/array_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/array_impl.hpp	(revision 306)
@@ -0,0 +1,179 @@
+#ifndef __XMLIO_CArray_impl__
+#define __XMLIO_CArray_impl__
+
+#include "array_mac.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+namespace xmlioserver
+{
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      template <typename ExtentList>
+         CArray<ValueType, NumDims, Allocator>::CArray(const ExtentList & sizes)
+            : boost::multi_array<ValueType, NumDims, Allocator>
+                  (sizes, boost::fortran_storage_order())
+   { /* Ne rien faire de plus */ }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+       CArray<ValueType, NumDims, Allocator>::CArray()
+            : boost::multi_array<ValueType, NumDims, Allocator>
+                  (getExtentNull<NumDims>(), boost::fortran_storage_order())
+   { /* Ne rien faire de plus */ }
+   
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      template <typename ExtentList>
+         CArray<ValueType, NumDims, Allocator>::CArray
+            (const ExtentList & sizes, const boost::general_storage_order<NumDims> & store)
+               : boost::multi_array<ValueType, NumDims, Allocator> (sizes, store)
+   { /* Ne rien faire de plus */ }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      CArray<ValueType, NumDims, Allocator>::~CArray(void)
+   { /* Ne rien faire de plus */ }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      StdOStream & operator << (StdOStream & os,
+                                const CArray<ValueType, NumDims, Allocator> & array)
+   {
+      os << "CArray (" ;
+      for (StdSize i = 1; i < array.num_dimensions(); i++)
+         os << ", " << array.shape()[i];
+      os << ") = " ; 
+      for (StdSize i = 0; i < array.num_elements(); i++) os << (array.data()[i])<<"  ";
+      return (os);
+   }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      StdOStream & operator << 
+         (StdOStream & os, const boost::shared_ptr<CArray<ValueType, NumDims, Allocator> > & array)
+   { 
+      os << *array; 
+      return (os); 
+   }
+   
+   //----------------------------------------------------------------
+   
+   template <typename ValueType> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 1) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 1, [1]);
+      array->fromBinary(is);
+   }
+   
+   template <typename ValueType> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 2) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 2, [1][1]);
+      array->fromBinary(is);
+   }
+
+   template <typename ValueType> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 3) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 3, [1][1][1]);
+      array->fromBinary(is);
+   }
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      void CArray<ValueType, NumDims, Allocator>::toBinary  (StdOStream & os) const
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize nelem = this->num_elements();
+      LSize ndim  = this->num_dimensions();
+      const LSize * shape = this->shape();
+      const ValueType * data = this->data();
+
+      os.write (reinterpret_cast<const char*>(&ndim) , sizeof(LSize));
+      for (LSize i = 0; i < ndim; i++ )
+         os.write (reinterpret_cast<const char*>(&(shape[i])), sizeof(LSize));
+      os.write (reinterpret_cast<const char*>(&nelem), sizeof(LSize));
+      os.write (reinterpret_cast<const char*>(data), nelem * sizeof(ValueType));
+   }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      void CArray<ValueType, NumDims, Allocator>::fromBinary(StdIStream & is)
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize ndim = 0, nelem = 0, temp = 0;
+      std::vector<LSize> shape;
+      is.read (reinterpret_cast<char*>(&ndim) , sizeof(LSize));
+      for (LSize i = 0; i < ndim; i++ )
+      {
+         is.read (reinterpret_cast<char*>(&temp) , sizeof(LSize));
+         shape.push_back(temp);
+      }
+      this->resize(shape);
+      is.read (reinterpret_cast<char*>(&nelem), sizeof(LSize));
+      is.read (reinterpret_cast<char*>(this->data()), nelem * sizeof(ValueType));
+   }
+  
+    template <typename ValueType, StdSize NumDims, typename Allocator>
+    size_t CArray<ValueType, NumDims, Allocator>::getSize(void) const
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize nelem = this->num_elements();
+      LSize ndim  = this->num_dimensions();
+      const LSize * shape = this->shape();
+      const ValueType * data = this->data();
+      size_t ret ;
+      ret=sizeof(ndim) ;
+      for (LSize i = 0; i < ndim; i++ ) ret+=sizeof(shape[i]) ;
+      ret+=sizeof(nelem) ;
+      ret+=sizeof(ValueType)*nelem ;
+      return ret ;
+   }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+   bool CArray<ValueType, NumDims, Allocator>::toBuffer(CBufferOut& buffer) const
+   {
+      typedef boost::multi_array_types::size_type LSize;
+
+      LSize nelem = this->num_elements();
+      LSize ndim  = this->num_dimensions();
+      const LSize* shape = this->shape();
+      const ValueType* data = this->data();
+      bool ret ;
+      
+      ret=buffer.put(ndim) ;
+      for (LSize i = 0; i < ndim; i++ ) ret&=buffer.put(shape[i]) ;
+      ret&=buffer.put(nelem) ;
+      ret&=buffer.put(data,nelem) ;
+      return ret ;
+  }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+   bool CArray<ValueType, NumDims, Allocator>::fromBuffer(CBufferIn& buffer)
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize ndim = 0, nelem = 0, temp = 0;
+      std::vector<LSize> shape;
+      bool ret ;
+      
+      ret=buffer.get(ndim) ;
+      for (LSize i = 0; i < ndim; i++ )
+      {
+         ret&=buffer.get(temp) ;
+         shape.push_back(temp);
+      }
+      this->resize(shape);
+      ret&=buffer.get(nelem) ;
+      ret&=buffer.get(this->data(),nelem) ;
+      return ret ;
+   }
+   
+
+   ///---------------------------------------------------------------
+   
+} // namespace xmlioserver
+
+#endif // __XMLIO_CArray_impl__
Index: /XIOS/trunk/src/array_mac.hpp
===================================================================
--- /XIOS/trunk/src/array_mac.hpp	(revision 306)
+++ /XIOS/trunk/src/array_mac.hpp	(revision 306)
@@ -0,0 +1,26 @@
+#ifndef __XMLIO_CArray_mac__
+#define __XMLIO_CArray_mac__
+
+/// ////////////////////// Macros ////////////////////// ///
+
+// Type Fortran
+#define ARRAY(valuetype, numdims) boost::shared_ptr<CArray<valuetype, numdims> >
+
+#define ARRAY_ASSIGN(value, valuetype, numdims, extent)\
+   value.reset(new CArray<valuetype, numdims>(boost::extents extent)) 
+
+#define ARRAY_CREATE(value, valuetype, numdims, extent)\
+   ARRAY(valuetype, numdims) value =                   \
+   ARRAY(valuetype, numdims)(new CArray<valuetype, numdims>(boost::extents extent))
+
+// Type C
+#define ARRAY_C_ASSIGN(value, valuetype, numdims, extent)\
+   value = ARRAY(valuetype, numdims)                     \
+   (new CArray<valuetype, numdims>(boost::extents extent, c_storage_order()))
+
+#define ARRAY_C_CREATE(value, valuetype, numdims, extent)\
+   ARRAY_C_ASSIGN(ARRAY(valuetype, numdims) value, valuetype, numdims, extent)
+
+///---------------------------------------------------------------
+
+#endif // __XMLIO_CArray_mac__
Index: /XIOS/trunk/src/attribute.cpp
===================================================================
--- /XIOS/trunk/src/attribute.cpp	(revision 306)
+++ /XIOS/trunk/src/attribute.cpp	(revision 306)
@@ -0,0 +1,86 @@
+#include "attribute.hpp"
+#include "base_type.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CAttribute::CAttribute(const StdString & id)
+         : CObject(id), CBaseType()
+         , value()
+      { /* Ne rien faire de plus */ }
+
+      CAttribute::CAttribute(const CAttribute & attribut)
+         : CObject(attribut.getId()),CBaseType()
+      { 
+         this->value = attribut.getAnyValue(); 
+      }
+      
+      CAttribute::~CAttribute(void)
+      { /* Ne rien faire de plus */ }
+      
+      ///--------------------------------------------------------------
+
+      const boost::any & CAttribute::getAnyValue(void) const
+      { 
+         return (this->value); 
+      }
+
+
+      void CAttribute::setAnyValue(const boost::any & value)
+      { 
+         this->value = value; 
+      }
+      
+      void CAttribute::clear(void)
+      {
+         this->value = boost::any(); 
+      }
+
+      //---------------------------------------------------------------
+
+      bool CAttribute::isEmpty(void) const
+      { 
+         return (this->value.empty()); 
+      }
+
+      const StdString & CAttribute::getName(void) const
+      { 
+         return (this->getId()); 
+      }
+      
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+      
+      CMessage& operator<<(CMessage& msg,tree::CAttribute& type)
+      {
+        msg.push(type) ;
+        return msg ;
+      }
+
+     CMessage& operator<<(CMessage& msg, const tree::CAttribute&  type)
+     {
+       msg.push(*type.duplicate()) ;
+       return msg ;
+     }
+ 
+      CBufferOut& operator<<(CBufferOut& buffer, tree::CAttribute&  type)
+     {
+    
+       if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, tree::CAttribute&  type)",
+                                           <<"Buffer remain size is to low for size type") ;
+      return buffer ;
+     }
+     
+     CBufferIn& operator>>(CBufferIn& buffer, tree::CAttribute&  type)
+     {
+    
+       if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, tree::CAttribute&  type)",
+                                           <<"Buffer remain size is to low for size type") ;
+       return buffer ;
+     }
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/attribute.hpp
===================================================================
--- /XIOS/trunk/src/attribute.hpp	(revision 306)
+++ /XIOS/trunk/src/attribute.hpp	(revision 306)
@@ -0,0 +1,101 @@
+#ifndef __XMLIO_CAttribute__
+#define __XMLIO_CAttribute__
+
+/// boost headers ///
+#include <boost/any.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "object.hpp"
+#include "base_type.hpp"
+#include "message.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAttribute : public CObject, public CBaseType
+      {
+            typedef CObject SuperClass;
+
+         public :
+
+            /// Constructeurs ///
+            explicit CAttribute(const StdString & id);
+            CAttribute(const CAttribute & attribut);
+            CAttribute(const CAttribute * const attribut); // Not implemented.
+
+            /// Accesseurs ///
+            const StdString & getName(void) const;
+            const boost::any & getAnyValue(void) const;
+            template <typename T> inline T getValue(void) const;
+            template <typename T> inline T* getRef(void);
+
+            /// Mutateurs ///
+            template <typename T> inline void setValue(const T & value);
+            void setAnyValue(const boost::any & value);
+            void clear(void);
+
+            /// Test ///
+            bool isEmpty(void) const;
+            template <typename T> inline bool isType(void);
+
+            /// Destructeur ///
+            virtual ~CAttribute(void);
+
+            /// Autres ///
+            virtual StdString toString(void) const = 0;
+            virtual void fromString(const StdString & str) = 0;
+
+            virtual void toBinary  (StdOStream & os) const = 0;
+            virtual void fromBinary(StdIStream & is) = 0;
+
+         protected :
+
+            /// Constructeurs ///
+            CAttribute(void);  // Not implemented.
+
+            /// PropriÃ©tÃ© ///
+            boost::any value;
+
+      }; // class CAttribute
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      template <typename T>
+         T CAttribute::getValue(void) const
+      { 
+         return (boost::any_cast<T>(this->value)); 
+      }
+
+      template <typename T>
+         T* CAttribute::getRef(void)
+      { 
+         return (boost::any_cast<T>(&value)); 
+      }
+
+      template <typename T>
+         void CAttribute::setValue(const T & value)
+      { 
+         this->value = value; 
+      }
+
+      template<typename T>
+         bool CAttribute::isType(void)
+      { 
+         return (this->value.type() == typeid(T)); 
+      }
+
+   } // namespace tree
+ 
+   CMessage& operator<<(CMessage& msg,tree::CAttribute& type) ;
+   CMessage& operator<<(CMessage& msg, const tree::CAttribute&  type) ;
+ 
+   CBufferOut& operator<<(CBufferOut& buffer,tree::CAttribute& type) ;
+   CBufferIn& operator>>(CBufferIn& buffer, tree::CAttribute&  type) ;
+}
+  // namespace xmlioserver
+
+#endif // __XMLIO_CAttribute__
Index: /XIOS/trunk/src/attribute_map.cpp
===================================================================
--- /XIOS/trunk/src/attribute_map.cpp	(revision 306)
+++ /XIOS/trunk/src/attribute_map.cpp	(revision 306)
@@ -0,0 +1,191 @@
+#include "attribute_map.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CAttributeMap * CAttributeMap::Current = NULL;
+
+      CAttributeMap::CAttributeMap(void)
+         : xios_map<StdString, CAttribute*>()
+      { CAttributeMap::Current = this; }
+
+      CAttributeMap::~CAttributeMap(void)
+      { /* Ne rien faire de plus */ }
+      
+      ///--------------------------------------------------------------
+
+      void CAttributeMap::clearAllAttributes(void)
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
+         for (; it != end; it++)
+         {
+            const StdStrAttPair & att = *it;
+            if (!att.second->isEmpty())
+               att.second->clear();
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      bool CAttributeMap::hasAttribute(const StdString & key) const
+      { 
+         return (this->find(key) != this->end()); 
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::setAttribute(const StdString & key, CAttribute * const attr)
+      {
+         if (!this->hasAttribute(key))
+            ERROR("CAttributeMap::setAttribute(key, attr)",
+                   << "[ key = " << key << "] key not found !");
+         if (attr == NULL)
+            ERROR("CAttributeMap::setAttribute(key, attr)",
+                   << "[ key = " << key << "] attr is null !");
+         this->find(key)->second->setAnyValue(attr->getAnyValue());
+      }
+      
+      //---------------------------------------------------------------
+      
+      CAttribute * CAttributeMap::operator[](const StdString & key)
+      {
+         if (!this->hasAttribute(key))
+            ERROR("CAttributeMap::operator[](const StdString & key)",
+                  << "[ key = " << key << "] key not found !");
+         return (SuperClassMap::operator[](key));
+      }
+      
+      //---------------------------------------------------------------
+      
+      StdString CAttributeMap::toString(void) const
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         StdOStringStream oss;
+         
+         SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
+         for (; it != end; it++)
+         {
+            const StdStrAttPair & att = *it;
+            if (!att.second->isEmpty())
+               oss << *att.second << " ";
+         }
+         return (oss.str());
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::fromString(const StdString & str)
+      { 
+         ERROR("CAttributeMap::fromString(const StdString & str)",
+               << "[ str = " << str << "] Not implemented yet !"); 
+      }
+      
+      //---------------------------------------------------------------
+
+      //StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap)
+      //{ os << attributmap.toString(); return (os); }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::setAttributes(const xml::THashAttributes & attributes)
+      {
+         for (xml::THashAttributes::const_iterator it  = attributes.begin();
+                                                   it != attributes.end();
+                                                   it ++)
+         {
+            if ((*it).first.compare(StdString("id")) != 0 &&
+                (*it).first.compare(StdString("src"))!= 0)
+            {
+               //if (CAttributeMap::operator[]((*it).first)->isEmpty())
+               CAttributeMap::operator[]((*it).first)->fromString((*it).second);
+            }
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::setAttributes(const CAttributeMap * const _parent)
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         
+         SuperClassMap::const_iterator it = _parent->begin(), end = _parent->end();
+         for (; it != end; it++)
+         {
+            const StdStrAttPair & el = *it;
+            if (this->hasAttribute(el.first))
+            {
+               CAttribute * currAtt = CAttributeMap::operator[](el.first);
+               if (currAtt->isEmpty() && !el.second->isEmpty())
+               {
+                  this->setAttribute(el.first, el.second);
+               }
+            }
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::toBinary(StdOStream & os) const
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         SuperClassMap::const_iterator it = this->begin(), end = this->end();
+         
+         const StdSize nbatt = SuperClassMap::size();
+         os.write (reinterpret_cast<const char*>(&nbatt) , sizeof(StdSize));
+         
+         for (; it != end; it++)
+         {
+            const StdString & key   = it->first;
+            const CAttribute* value = it->second;            
+            const StdSize size = key.size();
+            
+            os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
+            os.write (key.data(), size * sizeof(char));
+            
+            if (!value->isEmpty())
+            {
+               bool b = true;
+               os.write (reinterpret_cast<const char*>(&b) , sizeof(bool));
+               value->toBinary(os);
+            }
+            else 
+            {
+               bool b = false;
+               os.write (reinterpret_cast<const char*>(&b) , sizeof(bool));
+            }
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CAttributeMap::fromBinary(StdIStream & is)
+      {
+         StdSize nbatt = 0;
+         is.read (reinterpret_cast<char*>(&nbatt), sizeof(StdSize));
+         
+         for (StdSize i = 0; i < nbatt; i++)
+         {
+            bool hasValue = false;
+            StdSize size  = 0;
+            is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+            StdString key(size, ' ');
+            is.read (const_cast<char *>(key.data()), size * sizeof(char));
+            
+            if (!this->hasAttribute(key))
+               ERROR("CAttributeMap::fromBinary(StdIStream & is)",
+                     << "[ key = " << key << "] key not found !");
+                                        
+            is.read (reinterpret_cast<char*>(&hasValue), sizeof(bool));
+            
+            if (hasValue)          
+               this->operator[](key)->fromBinary(is);
+         }
+      }
+      
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioser
Index: /XIOS/trunk/src/attribute_map.hpp
===================================================================
--- /XIOS/trunk/src/attribute_map.hpp	(revision 306)
+++ /XIOS/trunk/src/attribute_map.hpp	(revision 306)
@@ -0,0 +1,66 @@
+#ifndef __XMLIO_CAttributeMap__
+#define __XMLIO_CAttributeMap__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "attribute.hpp"
+#include "attribute_template.hpp"
+#include "exception.hpp"
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAttributeMap
+         : public xios_map<StdString, CAttribute*>
+      {
+            typedef xios_map<StdString, CAttribute*> SuperClassMap;
+
+         public :
+
+            /// Tests ///
+            inline bool hasAttribute(const StdString & key) const;
+
+            /// Accesseurs ///
+            CAttribute * operator[](const StdString & key);
+
+            /// Mutateurs ///
+            void setAttribute(const StdString & key, CAttribute * const attr);
+
+            void setAttributes(const xml::THashAttributes & attributes);
+            void setAttributes(const CAttributeMap * const _parent);
+
+            void clearAllAttributes(void);
+
+            /// Destructeur ///
+            virtual ~CAttributeMap(void);
+
+            /// Flux ///
+            // Debug only //
+            // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap);
+
+            /// Autre ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+            
+            virtual void toBinary  (StdOStream & os) const;
+            virtual void fromBinary(StdIStream & is);
+
+         protected :
+
+            /// Constructeurs ///
+            CAttributeMap(void);
+            CAttributeMap(const xios_map<StdString, CAttribute*> & umap);       // Never implemented.
+            CAttributeMap(const xios_map<StdString, CAttribute*> * const umap); // Not implemented.
+
+            /// PropriÃ©tÃ© statique ///
+            static CAttributeMap * Current;
+
+      };  // class CAttributeMap
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeMap__
Index: /XIOS/trunk/src/attribute_template.cpp
===================================================================
--- /XIOS/trunk/src/attribute_template.cpp	(revision 306)
+++ /XIOS/trunk/src/attribute_template.cpp	(revision 306)
@@ -0,0 +1,219 @@
+#include "attribute_template.hpp"
+#include "attribute_template_impl.hpp"
+
+#include <cfloat>
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+      
+      template <>
+         StdString CAttributeTemplate<bool>::toString(void) const
+      {
+         StdOStringStream oss;
+         if (!this->isEmpty() && this->hasId())
+         {
+            if (this->getValue())
+               oss << this->getName() << "=\".TRUE.\"";
+            else
+               oss << this->getName() << "=\".FALSE.\"";
+         }
+         return (oss.str());
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromString(const StdString & str)
+      { 
+         this->setValue(str); 
+      }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromString(const StdString & str)
+      {
+         try
+         {
+            this->setValue(boost::lexical_cast<int>(str));
+         }
+         catch(boost::bad_lexical_cast &)
+         {
+            ERROR("void CAttributeTemplate<int>::fromString(const StdString & str)",
+                  << "[ str = " << str << " ] Bad cast !");
+         }
+      }
+
+      template <> // Double
+         void CAttributeTemplate<double>::fromString(const StdString & str)
+      {
+         if (str.find("max") != StdString::npos)
+         {
+            this->setValue(DBL_MAX);
+            return;
+         }
+         if (str.find("min") != StdString::npos)
+         {
+            this->setValue(DBL_MIN);
+            return;
+         }
+         
+         try
+         {
+            this->setValue(boost::lexical_cast<double>(str));
+         }
+         catch(boost::bad_lexical_cast &)
+         {
+            ERROR("void CAttributeTemplate<double>::fromString(const StdString & str)",
+                  << "[ str = " << str << " ] Bad cast !");
+         }
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromString(const StdString & str)
+      {
+         if (str.find(".TRUE.") != StdString::npos)
+            this->setValue(true);
+         else
+            this->setValue(false);
+      }
+
+      //---------------------------------------------------------------
+
+      template<> // Tableau
+         void CAttributeTemplate<ARRAY(double, 1)>::fromString(const StdString & str)
+      {
+         ARRAY_CREATE(array_sptr, double, 1, [1]);
+         CArray<double, 1> & array = *array_sptr;
+         this->setValue(array_sptr);
+
+         StdIStringStream iss(str) ;
+         char c = '\0'; int size = 0;
+         double d = 0.,valsup = 0., valinf = 0.;
+         std::vector<double> vect;
+
+         iss >> d; vect.push_back(d);
+         size = vect.size();
+         if (!iss.eof ())
+         {
+            iss >> c;
+            switch (c)
+            {
+               case ',' : // Le tableau est gÃ©nÃ©rÃ© valeur par valeur.
+                  iss.unget();
+                  while(!iss.eof ())
+                  { // On rÃ©cupÃšre chacune des valeurs une par une jusqu'Ã  ce que le buffer soit vide.
+                     iss >> c >> d;
+                     if (c != ',')
+                        ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                              << "[ str = " << str << " ] bad definition of array !");
+                     vect.push_back(d);
+                  }
+                  size = vect.size();
+                  break;
+               case '(' : // Le tableau est gÃ©nÃ©rÃ© automatiquement.
+                  if (!iss.eof ())
+                  { // on rÃ©cupÃšre la borne supÃ©rieure
+                     valinf = d;
+                     iss >> size >> c >> d;
+                     if ((c != ')') || (size <= 0))
+                        ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                              << "[ str = " << str << " ] bad definition of array !");
+                     valsup = d;
+                  }
+                  d = (valsup - valinf) / (double)(size - 1);
+                  for (int j = 1; j <= size; j++)
+                     vect.push_back(valinf + j * d);
+                  break;
+               default :
+                  ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                        << "[ str = " << str << " ] bad definition of array !");
+            }
+         }
+
+         array.resize(boost::extents[size]);
+         for (int i = 0; i < size; i++)
+            array[i] = vect[i]; 
+
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::toBinary (StdOStream & os) const
+      {
+         StdString str = this->getValue();
+         StdSize size = str.size();
+         os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
+         os.write (str.data(), size * sizeof(char));
+      }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::toBinary(StdOStream & os) const
+      {
+         int value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(int));
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::toBinary(StdOStream & os) const
+      {
+         bool value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(bool));
+      }
+
+      template <> // Double
+         void CAttributeTemplate<double>::toBinary(StdOStream & os) const
+      {
+         double value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(double));
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromBinary(StdIStream & is)
+      {
+         StdSize size = 0;
+         is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+         StdString value(size, ' ');
+         is.read (const_cast<char *>(value.data()), size * sizeof(char));
+         this->setValue(value);
+      }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromBinary(StdIStream & is)
+      {
+         int value = 0;
+         is.read (reinterpret_cast<char*>(&value), sizeof(int));
+         this->setValue(value);
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromBinary(StdIStream & is)
+      {
+         bool value = false;
+         is.read (reinterpret_cast<char*>(&value), sizeof(bool));
+         this->setValue(value);
+      }
+
+      template <> // Double
+         void CAttributeTemplate<double>::fromBinary(StdIStream & is)
+      {
+         double value = 0.;
+         is.read (reinterpret_cast<char*>(&value), sizeof(double));
+         this->setValue(value);
+      }
+
+      ///--------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/attribute_template.hpp
===================================================================
--- /XIOS/trunk/src/attribute_template.hpp	(revision 306)
+++ /XIOS/trunk/src/attribute_template.hpp	(revision 306)
@@ -0,0 +1,81 @@
+#ifndef __XMLIO_CAttributeTemplate__
+#define __XMLIO_CAttributeTemplate__
+
+/// boost headers ///
+#include <boost/lexical_cast.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+#include "attribute.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      template <class T>
+         class CAttributeTemplate : public CAttribute
+      {
+            typedef CAttribute SuperClass;
+
+         public :
+
+            /// Typedef ///
+            typedef T ValueType;
+
+            /// Constructeurs ///
+            explicit CAttributeTemplate(const StdString & id);
+            CAttributeTemplate(const StdString & id,
+                               xios_map<StdString, CAttribute*> & umap);
+            CAttributeTemplate(const StdString & id, const ValueType & value);
+            CAttributeTemplate(const StdString & id, const ValueType & value,
+                               xios_map<StdString, CAttribute*> & umap);
+            CAttributeTemplate(const CAttribute & attribut) throw (CException);
+            CAttributeTemplate(const CAttribute * const attribut); // Not implemented.
+
+          public :
+
+            /// Accesseur ///
+            inline ValueType getValue(void) const;
+            inline ValueType* getRef(void) ;
+
+            /// Mutateurs ///
+            inline void setValue(const ValueType & value);
+
+            /// Destructeur ///
+            virtual ~CAttributeTemplate(void);
+
+            /// Operateur ///
+            ValueType operator=(const ValueType & value);
+
+            /// Autre ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+            virtual void toBinary  (StdOStream & os) const;
+            virtual void fromBinary(StdIStream & is);            
+
+            virtual bool toBuffer  (CBufferOut& buffer) const;
+            virtual bool fromBuffer(CBufferIn& buffer) ;
+            virtual size_t size(void) const;
+   
+
+         protected :
+
+            /// Constructeurs ///
+            CAttributeTemplate(void); // Not implemented.
+
+      }; // class CAttribute    
+      
+   } // namespace tree
+   
+   template <class T>  void FromBinary(StdIStream & is, T & obj);
+   
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeTemplate__
Index: /XIOS/trunk/src/attribute_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/attribute_template_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/attribute_template_impl.hpp	(revision 306)
@@ -0,0 +1,245 @@
+#ifndef __XMLIO_CAttributeTemplate_impl__
+#define __XMLIO_CAttributeTemplate_impl__
+
+#include "array.hpp"
+#include "type.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id)
+         : CAttribute(id)
+      { /* Ne rien faire de plus */ }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id, const T & value)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const CAttribute & attribut)
+         throw (CException)
+         : CAttribute(attribut)
+      {
+         if (!attribut.isEmpty() && !attribut.isType<T>())
+            ERROR("CAttributeTemplate", << "Invalid instantiation !");
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id,
+                              xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate
+            (const StdString & id, const T & value,
+             xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::~CAttributeTemplate(void)
+      { 
+         this->clear();
+      }
+
+      ///--------------------------------------------------------------
+
+      template <class T>
+         T CAttributeTemplate<T>::getValue(void) const
+      {
+         if (SuperClass::isEmpty())
+         {
+            ERROR("T CAttributeTemplate<T>::getValue(void) const",
+                  << "[ id = " << this->getId() << "]"
+                  << " L'attribut est requis mais n'est pas dÃ©fini !");
+          }
+         return (SuperClass::getValue<T>());
+      }
+
+      template <class T>
+         T* CAttributeTemplate<T>::getRef(void)
+      {
+         if (SuperClass::isEmpty())
+         {
+            ERROR("T CAttributeTemplate<T>::getValue(void) const",
+                  << "[ id = " << this->getId() << "]"
+                  << " L'attribut est requis mais n'est pas dÃ©fini !");
+          }
+         return (SuperClass::getRef<T>());
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::setValue(const T & value)
+      {
+         SuperClass::setValue<T>(value);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         T CAttributeTemplate<T>::operator=(const T & value)
+      {
+         this->setValue(value);
+         return (this->getValue());
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         StdString CAttributeTemplate<T>::toString(void) const
+      {
+         StdOStringStream oss;
+         if (!this->isEmpty() && this->hasId())
+            oss << this->getName() << "=\"" << this->getValue() << "\"";
+         return (oss.str());
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::fromString(const StdString & str)
+      {
+         ERROR("CAttributeTemplate<T>::fromString(const StdString & str)",
+               << "[ str = " << str << " ] Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CAttributeTemplate<T>::toBinary (StdOStream & os) const
+      {
+         this->getValue()->toBinary(os);
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::fromBinary(StdIStream & is)
+      {
+         T value;
+         FromBinary(is, value);
+         this->setValue(value);
+      }
+
+      template <class T>
+         bool CAttributeTemplate<T>::toBuffer (CBufferOut& buffer) const
+      {
+         if (isEmpty()) return buffer.put(true) ;
+         else
+         {
+           bool ret=true ;
+           CType<T> val(*boost::any_cast<T>(&value)) ;
+           ret&=buffer.put(false) ;
+           ret&=val.toBuffer(buffer) ;
+           return ret ;
+         }
+      }
+
+      template <class T>
+      bool CAttributeTemplate<T>::fromBuffer(CBufferIn& buffer)
+      {
+        bool empty ;
+        bool ret=true ;
+        ret&=buffer.get(empty) ;
+        if (empty) 
+        {
+          clear() ;
+          return ret ;
+        }
+        else
+        {
+          if (isEmpty())
+          {
+            T val ;
+            setValue(val) ;
+          }
+          T* V=const_cast<T*>(boost::any_cast<T>(&value)) ;
+          CType<T> val(*V) ;
+          return val.fromBuffer(buffer) ;
+        }
+      }
+
+      template <class T>
+      size_t CAttributeTemplate<T>::size(void) const
+      {
+        if (isEmpty()) return sizeof(bool) ;
+        else
+        {
+          CType<T> val(*const_cast<T*>(boost::any_cast<T>(&value))) ;
+          return val.size()+sizeof(bool) ;
+        }
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+
+      template <>
+         StdString CAttributeTemplate<bool>::toString(void) const;
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromString(const StdString & str);
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromString(const StdString & str);
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromString(const StdString & str);
+
+      template <> // Double
+         void CAttributeTemplate<double>::fromString(const StdString & str);
+
+      template<> // Tableau
+         void CAttributeTemplate<ARRAY(double, 1)>::fromString(const StdString & str);
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::toBinary (StdOStream & os) const;
+
+      template <> // Entier
+         void CAttributeTemplate<int>::toBinary(StdOStream & os) const;
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::toBinary(StdOStream & os) const;
+         
+      template <> // Double
+         void CAttributeTemplate<double>::toBinary(StdOStream & os) const;
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromBinary(StdIStream & is);
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromBinary(StdIStream & is);
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromBinary(StdIStream & is);
+         
+      template <> // Double
+         void CAttributeTemplate<double>::fromBinary(StdIStream & is);
+
+      ///--------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeTemplate_impl__
Index: /XIOS/trunk/src/buffer.cpp
===================================================================
--- /XIOS/trunk/src/buffer.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer.cpp	(revision 306)
@@ -0,0 +1,266 @@
+#include "buffer.hpp"
+
+#include "mpi_manager.hpp"
+#include "buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBuffer::CBuffer(StdSize size)
+         : size(size), delIdata(true)
+      {
+         this->idata = new char[size]();
+         //CMPIManager::AllocMem(&idata, size);
+      }
+
+      CBuffer::CBuffer(char * data, StdSize size)
+         : size(size), delIdata(false)
+      {
+         this->idata = data;
+      }
+      
+      CBuffer::CBuffer(const CBuffer & buffer)
+         : size(buffer.size), delIdata(true)
+      {
+         this->idata = new char[size]();
+         std::copy (buffer.idata, buffer.idata+size, this->idata);
+      }
+      
+      CBuffer::CBuffer(const CBuffer * const buffer)
+         : size(buffer->size), delIdata(true)
+      {
+         this->idata = new char[size]();
+         std::copy (buffer->idata, buffer->idata+size, this->idata);       
+      }
+
+      CBuffer::~CBuffer(void)
+      {
+         if (delIdata) delete [] this->idata;
+         else this->fillData('\0', this->getSize(), 0);
+         //CMPIManager::FreeMem(idata);
+      }
+
+      ///--------------------------------------------------------------
+
+      CBuffer::operator char * (void)
+      { return (this->getData()); }
+
+      char * CBuffer::operator[](StdSize position)
+      { return (this->getData(position)); }
+
+      //---------------------------------------------------------------
+
+      StdSize CBuffer::getSize(StdSize position) const
+      {
+         if (position > this->size)
+            ERROR("CBuffer::getSize(position)",
+                  << " Buffer size <  size + position !");
+         return (this->size - position);
+      }
+
+      char * CBuffer::getData(StdSize position) const
+      {
+         if (position > this->size)
+            ERROR("CBuffer::getData(position)",
+                   << " Buffer size < position !");
+         return &(this->idata[position]);
+      }
+
+      //---------------------------------------------------------------
+
+      void CBuffer::getData(char * data, StdSize size, StdSize position) const
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::copy(this->getData(position), this->getData(position + size), data);
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CBuffer::setData(const char * data, StdSize size, StdSize position)
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::copy(&(data[0]), &(data[size]), this->getData(position));
+      }
+
+      //---------------------------------------------------------------
+
+#define BufferDataTypeGetter(type, type_enum)\
+   template <> CBuffer::CBufferDataType \
+      CBuffer::getBufferDataType<type>(void) const { return (type_enum); }; \
+   template <> CBuffer::CBufferDataType \
+      CBuffer::getBufferDataType<ARRAY(type, 1)>(void) const { return (type_enum); };
+
+      BufferDataTypeGetter(bool, TBOOL8);
+      BufferDataTypeGetter(char, TCHAR8);
+      BufferDataTypeGetter(float, TFLOAT32);
+      BufferDataTypeGetter(double, TDOUBLE64);
+      BufferDataTypeGetter(long int, TINT32);
+
+#undef BufferDataTypeGetter
+
+
+      //---------------------------------------------------------------
+
+      void CBuffer::getBufferData(CBufferData & bufdata, StdSize position) const
+      {
+         StdSize currposition = position;
+         this->getData( reinterpret_cast<char*>(&(bufdata.type))
+                      , sizeof(CBufferDataType), currposition);
+         this->getData( reinterpret_cast<char*>(&(bufdata.isArray))
+                      , sizeof(bool), currposition += sizeof(CBufferDataType));
+         this->getData( reinterpret_cast<char*>(&(bufdata.size))
+                      , sizeof(StdSize), currposition += sizeof(bool));
+         this->getData( reinterpret_cast<char*>(&(bufdata.position))
+                      , sizeof(StdSize), currposition += sizeof(StdSize));
+      }
+
+      void CBuffer::setBufferData(const CBufferData & bufdata, StdSize position)
+      {
+         StdSize currposition = position;
+         this->setData( reinterpret_cast<const char*>(&(bufdata.type))
+                      , sizeof(CBufferDataType), currposition);
+         this->setData( reinterpret_cast<const char*>(&(bufdata.isArray))
+                      , sizeof(bool), currposition += sizeof(CBufferDataType));
+         this->setData( reinterpret_cast<const char*>(&(bufdata.size))
+                      , sizeof(StdSize), currposition += sizeof(bool));
+         this->setData( reinterpret_cast<const char*>(&(bufdata.position))
+                      , sizeof(StdSize), currposition += sizeof(StdSize));
+      }
+
+      //---------------------------------------------------------------
+
+#define CBufferGetter(type, Type)       \
+   type CBuffer::get##Type(StdSize position) const \
+   { type retvalue; this->getData<type>(retvalue, position); return (retvalue); }
+
+
+      CBufferGetter(char     , Char)
+      CBufferGetter(bool     , Bool)
+      CBufferGetter(float    , Float)
+      CBufferGetter(double   , Double)
+      CBufferGetter(long int , Int)
+
+#undef CBufferGetter
+
+      //---------------------------------------------------------------
+
+#define CBufferArrayGetter(type, Type) \
+   ARRAY(type, 1) CBuffer::get##Type##Array(StdSize position) const \
+   {  ARRAY_CREATE(retvalue, type, 1, [1]);                         \
+      this->getDataArray<type>(retvalue, position);                 \
+      return (retvalue); }
+
+      CBufferArrayGetter(char     , Char)
+      CBufferArrayGetter(bool     , Bool)
+      CBufferArrayGetter(float    , Float)
+      CBufferArrayGetter(double   , Double)
+      CBufferArrayGetter(long int , Int)
+
+#undef CBufferArrayGetter
+
+      StdString CBuffer::getString(StdSize position) const
+      {
+         ARRAY(char, 1) array = this->getCharArray(position);
+         return (StdString(array->data(), array->num_elements()));
+      }
+
+      //---------------------------------------------------------------
+
+#define CBufferSetter(type, Type) \
+      void  CBuffer::set##Type(type value, StdSize position) \
+      { this->setData(value, position); }
+
+      CBufferSetter(char     , Char)
+      CBufferSetter(bool     , Bool)
+      CBufferSetter(float    , Float)
+      CBufferSetter(double   , Double)
+      CBufferSetter(long int , Int)
+
+#undef CBufferSetter
+
+      //---------------------------------------------------------------
+
+#define CBufferArraySetter(type, Type) \
+      void  CBuffer::set##Type##Array(ARRAY(type, 1) value, StdSize position) \
+      { this->setDataArray(value, position); }
+
+      CBufferArraySetter(char     , Char)
+      CBufferArraySetter(bool     , Bool)
+      CBufferArraySetter(float    , Float)
+      CBufferArraySetter(double   , Double)
+      CBufferArraySetter(long int , Int)
+
+#undef CBufferArraySetter
+
+      void CBuffer::setString(const StdString & value, StdSize position)
+      {
+         ARRAY_CREATE(arr, char, 1, [value.size()]);
+         std::copy(value.data(), &(value.data()[value.size()]), arr->data());
+         this->setCharArray(arr, position);
+      }
+
+      //---------------------------------------------------------------
+
+      void CBuffer::printToBinaryFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToBinaryStream(ofs);
+         ofs.close();
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CBuffer::printToBinaryStream (StdOStream & ostr)
+      {  
+         ostr.write (this->getData(), this->getSize()); 
+      }
+      
+      //---------------------------------------------------------------
+      
+      StdSize CBuffer::getNextDataPosition(StdSize position)
+      {
+         CBufferData  bufdata;
+         this->updateBufferData(position);
+         this->getBufferData(bufdata, position);
+         return (bufdata.size + bufdata.position);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+         StdSize CBuffer::getRequestedSize(StdString data) const
+      { 
+         return (DATA_HEADER_SIZE + data.size() * sizeof (char)); 
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CBuffer::updateBufferData(StdSize position)
+      {
+         CBufferData bufdata;
+         this->getBufferData(bufdata, position);
+         bufdata.position = position + DATA_HEADER_SIZE;
+         this->setBufferData(bufdata, position);
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CBuffer::fillData(char data, StdSize size, StdSize position)
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::fill_n(this->getData(position), size, data);
+      }
+      
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/buffer.hpp
===================================================================
--- /XIOS/trunk/src/buffer.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer.hpp	(revision 306)
@@ -0,0 +1,142 @@
+#ifndef __XMLIO_CBuffer__
+#define __XMLIO_CBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBuffer
+      {
+         public :
+
+         //--------------------------------------------------------------
+
+            typedef enum buffer_data_type
+            { TBOOL8 = 0, TINT32, TCHAR8, TFLOAT32, TDOUBLE64
+            } CBufferDataType;
+
+            typedef struct  buffer_data
+            { CBufferDataType type; bool isArray; StdSize size; StdSize position;
+            } CBufferData;
+
+         //--------------------------------------------------------------
+
+            /// Operateurs ///
+            operator char * (void);
+            char * operator[](StdSize position);
+
+            /// Accesseurs ///
+            StdSize getSize(StdSize position = 0) const;
+            char * getData(StdSize position = 0) const;
+
+            template <class T>
+               inline StdSize getRequestedSize(T data) const;
+            template <class T>
+               inline StdSize getRequestedSize(ARRAY(T, 1) data) const;
+
+            StdSize getNextDataPosition(StdSize position);
+            static inline StdSize getDataHeaderSize(void) { return sizeof(CBufferDataType) + 2 * sizeof(StdSize) + sizeof(bool) ; }
+         //--------------------------------------------------------------
+
+            char     getChar  (StdSize position) const;
+            bool     getBool  (StdSize position) const;
+            float    getFloat (StdSize position) const;
+            double   getDouble(StdSize position) const;
+            long int getInt   (StdSize position) const;
+
+            StdString getString(StdSize position) const;
+
+            ARRAY(char,     1) getCharArray  (StdSize position) const;
+            ARRAY(bool,     1) getBoolArray  (StdSize position) const;
+            ARRAY(float,    1) getFloatArray (StdSize position) const;
+            ARRAY(double,   1) getDoubleArray(StdSize position) const;
+            ARRAY(long int, 1) getIntArray   (StdSize position) const;
+
+         //--------------------------------------------------------------
+
+            /// Mutateurs ///
+            void setChar  (char     value, StdSize position) ;
+            void setBool  (bool     value, StdSize position) ;
+            void setFloat (float    value, StdSize position) ;
+            void setDouble(double   value, StdSize position) ;
+            void setInt   (long int value, StdSize position) ;
+
+            void setString(const StdString & value, StdSize position) ;
+
+            void setCharArray  (ARRAY(char,     1) value, StdSize position) ;
+            void setBoolArray  (ARRAY(bool,     1) value, StdSize position) ;
+            void setFloatArray (ARRAY(float,    1) value, StdSize position) ;
+            void setDoubleArray(ARRAY(double,   1) value, StdSize position) ;
+            void setIntArray   (ARRAY(long int, 1) value, StdSize position) ;
+
+         //--------------------------------------------------------------
+
+            virtual void clear(void) = 0;
+            void updateBufferData(StdSize position);
+
+            /// Sortie fichier binaire ///
+            void printToBinaryFile (const StdString & filename);
+            void printToBinaryStream (StdOStream & ostr);
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename) = 0;
+            virtual void printToTextStream (StdOStream & ostr) = 0;
+
+            /// Destructeur ///
+            virtual ~CBuffer(void);
+
+         protected :
+
+            /// Construteurs ///
+            CBuffer(char * data, StdSize size);
+            explicit CBuffer(StdSize size);
+            CBuffer(const CBuffer & buffer);
+            CBuffer(const CBuffer * const buffer);
+
+            /// Accesseurs protÃ©gÃ©s ///
+            void getBufferData(CBufferData & bufdata, StdSize position) const;
+
+            template <class T>
+               inline void getData(T & data, StdSize position) const;
+            template <class T>
+               inline void getDataArray(ARRAY(T, 1) data, StdSize position) const;
+
+            /// Mutateurs protÃ©gÃ©s ///
+            template <class T>
+               inline void setData(const T & data, StdSize position);
+            template <class T>
+               inline void setDataArray(const ARRAY(T, 1) data, StdSize position);
+
+            void setData(const char * data, StdSize size, StdSize position);
+            void fillData(char data, StdSize size, StdSize position);
+
+         private :
+
+         //--------------------------------------------------------------
+
+            /// Accesseurs privÃ©s ///
+            void getData(char * data, StdSize size, StdSize position) const;
+            template <class T>
+               CBufferDataType getBufferDataType(void) const;
+
+            /// Mutateurs privÃ©s ///
+            void setBufferData(const CBufferData & bufdata, StdSize position);
+            
+         //--------------------------------------------------------------
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            StdSize size;
+            char * idata;
+            bool delIdata;
+
+      }; // class CBuffer
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBuffer__
Index: /XIOS/trunk/src/buffer_client.cpp
===================================================================
--- /XIOS/trunk/src/buffer_client.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_client.cpp	(revision 306)
@@ -0,0 +1,99 @@
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_out.hpp"
+#include "buffer_client.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  int CClientBuffer::bufferSizeByServer=50*1024*1024 ;
+//  int CClientBuffer::bufferSizeByServer=1024*10 ;
+
+  CClientBuffer::CClientBuffer(MPI_Comm interComm_,int serverRank_)
+  {
+    interComm=interComm_ ;
+    serverRank=serverRank_ ;
+    bufferSize=bufferSizeByServer/2 ;
+    buffer[0]=new char[bufferSize] ; // transform it with MPI_ALLOC_MEM later
+    buffer[1]=new char[bufferSize] ;
+    current=0 ;
+    count=0 ;
+    pending=false ;
+    retBuffer=new CBufferOut(buffer[current],bufferSize) ;
+  }
+  
+  CClientBuffer::~CClientBuffer()
+  {
+   delete [] buffer[0] ;
+   delete [] buffer[1] ;
+   delete retBuffer ;
+  }
+  
+  int CClientBuffer::remain(void)
+  {
+    return bufferSize-count ;
+  }
+  
+  bool CClientBuffer::isBufferFree(int size)
+  {
+    if (size>bufferSize) ERROR("CClientBuffer::hasSpace(int size)",
+                               <<"request size is too big for buffer, increase buffer client size");
+ 
+    if (size<=remain()) return true ;
+    else return false ;
+  }
+    
+  
+  CBufferOut*  CClientBuffer::getBuffer(int size)
+  {
+    if (size<=remain())
+    {
+      retBuffer->realloc(buffer[current]+count,size) ;
+      count+=size ;
+      return retBuffer ;
+    }
+    else
+    {
+       ERROR("CBufferOut*  CClientBuffer::getSpace(int size) ;",
+               <<"No ennough space in buffer, that may not happen...");
+       return NULL ;
+    }
+ 
+  }  
+  
+  bool CClientBuffer::checkBuffer(void)
+  {
+    MPI_Status status ;
+    int flag ;
+    
+    if (pending)
+    {
+      MPI_Test(&request,&flag,&status) ;
+      if (flag==true) pending=false ;
+    }
+
+    if (!pending)
+    {
+      if (count>0)
+      {
+        MPI_Issend(buffer[current],count,MPI_CHAR,serverRank,20,interComm,&request) ;
+        pending=true ;
+        if (current==1) current=0 ;
+        else current=1 ;
+        count=0 ;
+      }
+    }
+    return pending ;
+  }
+  
+  bool CClientBuffer::hasPendingRequest(void)
+  {
+    if (pending) return true ;
+    else if (count>0) return true ;
+    else return false ;
+  }
+    
+  
+  
+}    
+    
Index: /XIOS/trunk/src/buffer_client.hpp
===================================================================
--- /XIOS/trunk/src/buffer_client.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_client.hpp	(revision 306)
@@ -0,0 +1,42 @@
+#ifndef __BUFFER_CLIENT_HPP__
+#define __BUFFER_CLIENT_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "buffer_out.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  class CClientBuffer
+  {
+    
+    public:
+    
+    CClientBuffer(MPI_Comm intercomm,int serverRank) ;
+    ~CClientBuffer() ;
+    bool isBufferFree(int size) ;
+    CBufferOut*  getBuffer(int size) ;    
+    bool checkBuffer(void) ;
+    bool hasPendingRequest(void) ;
+    
+    char* buffer[2] ;
+    int remain(void) ;
+
+    int current ;
+    int count ;
+    int bufferSize ;
+    int serverRank ;
+    bool pending ;
+    
+    static int bufferSizeByServer ;
+    
+    MPI_Request request ;
+    
+    CBufferOut* retBuffer;    
+    MPI_Comm interComm ;
+  } ;
+
+}
+
+#endif
+
Index: /XIOS/trunk/src/buffer_impl.hpp
===================================================================
--- /XIOS/trunk/src/buffer_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_impl.hpp	(revision 306)
@@ -0,0 +1,100 @@
+#ifndef __XMLIO_CBuffer_impl__
+#define __XMLIO_CBuffer_impl__
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////// DÃ©finitions (inline) /////////////////// ///
+
+#define DATA_HEADER_SIZE  sizeof(CBuffer::CBufferDataType) + 2 * sizeof(StdSize) + sizeof(bool)
+
+      template <class T>
+         StdSize CBuffer::getRequestedSize(T data) const
+      { return (DATA_HEADER_SIZE + sizeof (T)); }
+
+      template <class T>
+         StdSize CBuffer::getRequestedSize(ARRAY(T, 1) data) const
+      { return (DATA_HEADER_SIZE + data->num_elements() * sizeof (T)); }
+
+      template <>
+         StdSize CBuffer::getRequestedSize(StdString data) const;
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CBuffer::getData(T & data, StdSize position) const
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::getData(data, position)",
+                   << " Buffer size <  size + position !");
+         CBufferData bufdata;
+         this->getBufferData(bufdata, position);
+         if (bufdata.type != this->getBufferDataType<T>())
+            ERROR("CBuffer::getData(data, position)", 
+                  << "[ BufferDataType Read : " << bufdata.type                 << ", "
+                  << ", BufferDataType T : "    << this->getBufferDataType<T>() << "] "
+                  << " invalid type !");
+         if (bufdata.isArray != false)
+            ERROR("CBuffer::getData(data, position)",
+                   << " type should be an array !");
+
+         this->getData(reinterpret_cast<char*>(&data), bufdata.size , bufdata.position);
+      }
+
+      template <class T>
+         void CBuffer::getDataArray(ARRAY(T, 1) data, StdSize position) const
+      {
+         CBufferData bufdata;
+         this->getBufferData(bufdata, position);
+         if (bufdata.type != this->getBufferDataType<T>())
+            ERROR("CBuffer::getDataArray(data, position)", << " invalid type !");
+         if (bufdata.isArray != true)
+            ERROR("CBuffer::getDataArray(data, position)",
+                  << " type should not be an array !");
+         if (this->size < (position + (DATA_HEADER_SIZE + bufdata.size)))
+            ERROR("CBuffer::getData<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         data->resize(boost::extents[bufdata.size/sizeof(T)]);
+         this->getData(reinterpret_cast<char*>(data->data()), bufdata.size , bufdata.position);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CBuffer::setData(const T & data, StdSize position)
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::setData<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         CBufferData bufdata;
+         bufdata.type     = this->getBufferDataType<T>();
+         bufdata.isArray  = false;
+         bufdata.size     = sizeof(T);
+         bufdata.position = position + DATA_HEADER_SIZE;
+         this->setBufferData(bufdata, position);
+         this->setData(reinterpret_cast<const char*>(&data), bufdata.size , bufdata.position);
+      }
+
+      template <class T>
+         void CBuffer::setDataArray(const ARRAY(T, 1) data, StdSize position)
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::setDataArray<T>(data, size, position)",
+                   << " Buffer size <  size + position !  :  "<<this->size<<" < "<<this->getRequestedSize(data)<<" + "<<position);
+         CBufferData bufdata;
+         bufdata.type     = this->getBufferDataType<T>();
+         bufdata.isArray  = true;
+         bufdata.size     = data->num_elements() * sizeof (T);
+         bufdata.position = position + DATA_HEADER_SIZE;
+
+         this->setBufferData(bufdata, position);
+         this->setData(reinterpret_cast<const char*>(data->data()),
+                       bufdata.size , bufdata.position);
+      }
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBuffer_impl__
Index: /XIOS/trunk/src/buffer_in.cpp
===================================================================
--- /XIOS/trunk/src/buffer_in.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_in.cpp	(revision 306)
@@ -0,0 +1,69 @@
+#include "xmlioserver_spl.hpp"
+#include "buffer_in.hpp"
+
+
+namespace xmlioserver
+{
+    CBufferIn::CBufferIn(void* buffer,size_t size)
+    {
+      own=false ;
+      realloc(buffer,size) ;
+    }
+    
+    CBufferIn::CBufferIn(size_t size)
+    {
+      own=false ;
+      realloc(size) ;
+    }
+
+    CBufferIn::CBufferIn(void)
+    {
+      own=false ;
+      realloc(0,0) ;      
+    }
+
+    void CBufferIn::realloc(size_t size)
+    {
+      realloc(new char[size_],size) ;
+      own=true ;
+    }
+
+    void CBufferIn::realloc(void* buffer,size_t size)
+    {
+      if (own) delete [] begin ;
+      begin=(char*)buffer ;
+      size_=size ;
+      current=begin ;
+      end=begin+size_ ;
+      count_=0 ;
+      own=false ;
+    }
+
+    bool CBufferIn::advance(size_t n) { return advance<char>(n); }
+
+    size_t CBufferIn::remain(void)
+    {
+      return size_-count_ ;
+    }    
+
+    size_t CBufferIn::count(void)
+    {
+      return count_ ;
+    }
+
+    size_t CBufferIn::size(void)
+    {
+      return size_ ;
+    }
+    
+    CBufferIn::~CBufferIn()
+    {
+      if (own) delete [] begin ;
+    }
+
+    void* CBufferIn::ptr(void) { return current; }
+    
+}
+    
+      
+    
Index: /XIOS/trunk/src/buffer_in.hpp
===================================================================
--- /XIOS/trunk/src/buffer_in.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_in.hpp	(revision 306)
@@ -0,0 +1,64 @@
+#ifndef __BUFFER_IN_HPP__
+#define __BUFFER_IN_HPP__
+
+
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+  
+    class CBufferIn
+    {
+    
+      public:
+      
+      CBufferIn(size_t size) ;
+      CBufferIn(void) ;
+      CBufferIn(void* buffer,size_t size) ;
+
+      void realloc(size_t size) ;
+      void realloc(void* buffer,size_t size) ;
+      
+
+      template<class T>
+      bool advance(size_t n) ;
+
+      bool advance(size_t n) ;
+      
+      template<class T>
+      bool get(T& data) ;
+
+      template<class T>
+      bool get(T* data, size_t n) ;
+
+      template<class T>
+      bool advance_template(size_t n) ;
+      
+      template<class T>
+      bool get_template(T& data) ;
+
+      template<class T>
+      bool get_template(T* data, size_t n) ;
+
+      void* ptr(void) ;
+
+      
+      size_t remain(void) ;
+      size_t count(void) ;                          
+      size_t size(void) ;                         
+      ~CBufferIn() ;
+
+       char* begin ;
+       char* end ;
+       char* current ;
+       size_t count_ ;
+       size_t size_ ;   
+       bool own ; 
+    } ;
+  
+}
+
+#include "buffer_in_impl.hpp" 
+
+
+#endif
Index: /XIOS/trunk/src/buffer_in_impl.hpp
===================================================================
--- /XIOS/trunk/src/buffer_in_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_in_impl.hpp	(revision 306)
@@ -0,0 +1,94 @@
+#ifndef __BUFFER_IN_IMPL_HPP__
+#define __BUFFER_IN_IMPL_HPP__
+
+namespace xmlioserver
+{
+
+// template spectialisation : CBufferIn::get
+
+    template <> bool CBufferIn::get<char>(char& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<bool>(bool& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<int>(int& data)   { return get_template(data) ; }
+    template <> bool CBufferIn::get<short>(short& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<long>(long& data)  { return get_template(data) ; }  
+    template <> bool CBufferIn::get<uint>(uint& data)  { return get_template(data) ; }  
+    template <> bool CBufferIn::get<ushort>(ushort& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<ulong>(ulong& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<float>(float& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<double>(double& data) { return get_template(data) ; }  
+    template <> bool CBufferIn::get<long double>(long double& data) { return get_template(data) ;}  
+
+    template <> bool CBufferIn::get<char>(char* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<bool>(bool* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<int>(int* data, size_t n)   { return get_template(data,n) ; }
+    template <> bool CBufferIn::get<short>(short* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<long>(long* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<uint>(uint* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<ushort>(ushort* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<ulong>(ulong* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<float>(float* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<double>(double* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBufferIn::get<long double>(long double* data, size_t n) { return get_template(data,n) ;}  
+
+    template <> bool CBufferIn::advance<char>(size_t n) { return advance_template<char>(n) ; }  
+    template <> bool CBufferIn::advance<bool>(size_t n) { return advance_template<bool>(n) ; }  
+    template <> bool CBufferIn::advance<int>(size_t n)   { return advance_template<int>(n) ; }
+    template <> bool CBufferIn::advance<short>(size_t n) { return advance_template<short>(n) ; }  
+    template <> bool CBufferIn::advance<long>(size_t n)  { return advance_template<long>(n) ; }  
+    template <> bool CBufferIn::advance<uint>(size_t n)  { return advance_template<uint>(n) ; }  
+    template <> bool CBufferIn::advance<ushort>(size_t n) { return advance_template<ushort>(n) ; }  
+    template <> bool CBufferIn::advance<ulong>(size_t n) { return advance_template<ulong>(n) ; }  
+    template <> bool CBufferIn::advance<float>(size_t n) { return advance_template<float>(n) ; }  
+    template <> bool CBufferIn::advance<double>(size_t n) { return advance_template<double>(n) ; }  
+    template <> bool CBufferIn::advance<long double>(size_t n) { return advance_template<long double>(n) ;}  
+
+    template <class T>
+    bool CBufferIn::get_template(T& data)
+    {
+      return get_template<T>(&data,1) ;
+    }
+        
+    template <class T>
+    bool CBufferIn::get_template(T* data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count_+dataSize<=size_)
+      {
+        dataBuff=(char*) data ;
+        for(size_t i=0;i<dataSize;i++) dataBuff[i]=current[i] ;
+        current+=dataSize ;
+        count_+=dataSize ;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+
+    template <class T>
+    bool CBufferIn::advance_template(size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count_+dataSize<=size_)
+      {
+        current+=dataSize ;
+        count_+=dataSize ;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }    
+
+}
+  
+
+#endif
Index: /XIOS/trunk/src/buffer_list.cpp
===================================================================
--- /XIOS/trunk/src/buffer_list.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_list.cpp	(revision 306)
@@ -0,0 +1,74 @@
+#include "buffer_list.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CBufferList::CBufferList(MPI_Comm com_client_server)
+         : SuperClass(CMPIManager::GetCommSize(com_client_server) - 1)
+         , com_client_server(com_client_server)
+         , nbbuffer(CMPIManager::GetCommSize(com_client_server) - 1)
+      { /* Ne rien faire de plus */ }
+
+      CBufferList::~CBufferList(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      bool CBufferList::hasRequests(void) const
+      {
+         bool retvalue = SuperClass::operator[](0).hasRequest();
+         for (StdSize i = 1; i < this->nbbuffer; i++)
+            retvalue = retvalue && SuperClass::operator[](i).hasRequest();
+         return (retvalue);
+      }
+
+      bool CBufferList::recvRequests(void)
+      {
+         while (!this->hasRequests())
+         {
+            for (int i = 1; i < CMPIManager::GetCommSize(com_client_server); i++)
+            {
+               if (CMPIManager::HasReceivedData(com_client_server, i))
+               {
+                  StdSize size = CMPIManager::GetReceivedDataSize(com_client_server, i);
+                  if (SuperClass::operator[](i-1).isAvailable(size))
+                  {
+                     CMPIManager::ReceiveCircularBuffer
+                        (com_client_server, i, SuperClass::operator[](i-1));
+                  }
+                  else
+                  {
+                     DEBUG ("Impossible d'Ã©crire dans le tampon " << i 
+                             << " (Taille requise : " << size << " octets,"
+                             << " Taille du buffer circulaire : "
+                             << SuperClass::operator[](i-1).getSize() << " octets)");
+                  }
+               }
+            }
+         }
+         
+
+            
+         return (true);
+      }
+
+      void CBufferList::getRequests(std::vector<CLinearBuffer> & lbuffer)
+      {
+         for (StdSize i = 0; i < this->nbbuffer; i++)
+         {
+            lbuffer.push_back(SuperClass::operator[](i).getNextRequest());
+         }
+      }
+
+      StdSize CBufferList::getNumberOfBuffers(void) const
+      { 
+         return (this->nbbuffer) ;
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/buffer_list.hpp
===================================================================
--- /XIOS/trunk/src/buffer_list.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_list.hpp	(revision 306)
@@ -0,0 +1,54 @@
+#ifndef __XMLIO_CBufferList__
+#define __XMLIO_CBufferList__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBufferList
+         : public std::vector<CCircularBuffer>   // << pas une liste
+      {
+
+            /// DÃ©finition de type ///
+            typedef std::vector<CCircularBuffer> SuperClass;
+            typedef CCircularBuffer BufferType;
+
+         public :
+
+            /// Construteurs ///
+            CBufferList(MPI_Comm com_client_server = CMPIManager::GetCommWorld());
+            CBufferList(const CBufferList & buffer_list);         // Not implemented yet.
+            CBufferList(const CBufferList * const buffer_list);   // Not implemented yet.
+
+            /// Test ///
+            bool hasRequests(void) const;
+
+            /// Traitement ///
+            bool recvRequests(void);
+
+            /// Accesseurs ///
+            StdSize getNumberOfBuffers(void) const;
+            void getRequests(std::vector<CLinearBuffer> & lbuffer);
+
+            /// Destructeur ///
+            virtual ~CBufferList(void);
+
+
+         private :
+
+            MPI_Comm com_client_server;
+            StdSize nbbuffer;
+
+      }; // class CBufferList
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBufferList__
Index: /XIOS/trunk/src/buffer_out.cpp
===================================================================
--- /XIOS/trunk/src/buffer_out.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_out.cpp	(revision 306)
@@ -0,0 +1,75 @@
+#include "xmlioserver_spl.hpp"
+#include "buffer_out.hpp"
+
+
+namespace xmlioserver
+{
+  namespace ym
+  {
+    CBufferOut::CBufferOut(void* buffer,size_t size)
+    {
+      own=false ;
+      realloc(buffer,size) ;
+    }
+    
+    CBufferOut::CBufferOut(void)
+    {
+      own=false ;
+      realloc(0,0) ;      
+    }
+
+    CBufferOut::CBufferOut(size_t size)
+    {
+      own=false ;
+      realloc(size) ;
+    }
+
+    void CBufferOut::realloc(size_t size)
+    {
+      realloc(new char[size],size) ;
+      own=true ;
+    }
+
+    void CBufferOut::realloc(void* buffer,size_t size)
+    {
+      if (own) delete [] begin ;
+      begin=(char*)buffer ;
+      size_=size ;
+      end=begin+size_ ;
+      count_=0 ;
+      current=begin ;
+      own=false ;
+    }
+
+    bool CBufferOut::advance(size_t n) { return advance<char>(n); }
+
+    void* CBufferOut::ptr(void)
+    {
+      return current ;
+    }
+    
+    size_t CBufferOut::remain(void)
+    {
+      return size_-count_ ;
+    }    
+
+    size_t CBufferOut::count(void)
+    {
+      return count_ ;
+    }
+
+    size_t CBufferOut::size(void)
+    {
+      return size_ ;
+    }
+        
+    CBufferOut::~CBufferOut()
+    {
+      if (own) delete [] begin ;
+    }
+    
+  }
+}
+    
+      
+    
Index: /XIOS/trunk/src/buffer_out.hpp
===================================================================
--- /XIOS/trunk/src/buffer_out.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_out.hpp	(revision 306)
@@ -0,0 +1,66 @@
+#ifndef __BUFFER_OUT_HPP__
+#define __BUFFER_OUT_HPP__
+
+
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+  
+    class CBufferOut
+    {
+    
+      public:
+      
+      CBufferOut(size_t size) ;
+      CBufferOut(void) ;
+      CBufferOut(void* buffer,size_t size) ;
+
+      void realloc(size_t size) ;
+      void realloc(void* buffer,size_t size) ;
+      
+      template<class T>
+      bool put(const T& data) ;
+
+      template<class T>
+      bool put(const T* data, size_t n) ;
+
+    
+      template<class T>
+      bool advance(size_t n) ;
+
+      bool advance(size_t n) ;
+      
+       
+ 
+      template<class T>
+      bool put_template(const T& data) ;
+
+      template<class T>
+      bool put_template(const T* data, size_t n) ;
+
+      template<class T>
+      bool advance_template(size_t n) ;
+      
+      void* ptr(void) ;
+            
+      size_t remain(void) ;
+      size_t count(void) ;
+      size_t size(void) ;
+                            
+      ~CBufferOut() ;
+       char* begin ;
+       char* current ;
+       char* end;
+       size_t count_ ;
+       size_t size_ ;
+       bool own ; 
+    } ;
+    
+
+}
+
+#include "buffer_out_impl.hpp" 
+
+
+#endif
Index: /XIOS/trunk/src/buffer_out_impl.hpp
===================================================================
--- /XIOS/trunk/src/buffer_out_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_out_impl.hpp	(revision 306)
@@ -0,0 +1,94 @@
+#ifndef __BUFFER_OUT_IMPL_HPP__
+#define __BUFFER_OUT_IMPL_HPP__
+
+namespace xmlioserver
+{
+
+// template spectialisation : CBufferIn::put
+    template <> bool CBufferOut::put<char>(const char& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<bool>(const bool& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<int>(const int& data)   { return put_template(data) ; }
+    template <> bool CBufferOut::put<short>(const short& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<long>(const long& data)  { return put_template(data) ; }  
+    template <> bool CBufferOut::put<uint>(const uint& data)  { return put_template(data) ; }  
+    template <> bool CBufferOut::put<ushort>(const ushort& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<ulong>(const ulong& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<float>(const float& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<double>(const double& data) { return put_template(data) ; }  
+    template <> bool CBufferOut::put<long double>(const long double& data) { return put_template(data) ;}  
+
+    template <> bool CBufferOut::put<char>(const char* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<bool>(const bool* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<int>(const int* data, size_t n)   { return put_template(data,n) ; }
+    template <> bool CBufferOut::put<short>(const short* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<long>(const long* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<uint>(const uint* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<ushort>(const ushort* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<ulong>(const ulong* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<float>(const float* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<double>(const double* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBufferOut::put<long double>(const long double* data, size_t n) { return put_template(data,n) ;}  
+
+
+    template <> bool CBufferOut::advance<char>(size_t n) { return advance_template<char>(n) ; }  
+    template <> bool CBufferOut::advance<bool>(size_t n) { return advance_template<bool>(n) ; }  
+    template <> bool CBufferOut::advance<int>(size_t n)   { return advance_template<int>(n) ; }
+    template <> bool CBufferOut::advance<short>(size_t n) { return advance_template<short>(n) ; }  
+    template <> bool CBufferOut::advance<long>(size_t n)  { return advance_template<long>(n) ; }  
+    template <> bool CBufferOut::advance<uint>(size_t n)  { return advance_template<uint>(n) ; }  
+    template <> bool CBufferOut::advance<ushort>(size_t n) { return advance_template<ushort>(n) ; }  
+    template <> bool CBufferOut::advance<ulong>(size_t n) { return advance_template<ulong>(n) ; }  
+    template <> bool CBufferOut::advance<float>(size_t n) { return advance_template<float>(n) ; }  
+    template <> bool CBufferOut::advance<double>(size_t n) { return advance_template<double>(n) ; }  
+    template <> bool CBufferOut::advance<long double>(size_t n) { return advance_template<long double>(n) ;}  
+
+    template <class T>
+    bool CBufferOut::put_template(const T& data)
+    {
+      return put_template<T>(&data,1);
+    }
+    
+    template <class T>
+    bool CBufferOut::put_template(const T* data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count_+dataSize<=size_)
+      {
+        dataBuff=(char*) data ;
+        for(size_t i=0;i<dataSize;i++) current[i]=dataBuff[i] ;
+        current+=dataSize ;
+        count_+=dataSize;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+
+    template <class T>
+    bool CBufferOut::advance_template(size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count_+dataSize<=size_)
+      {
+        current+=dataSize ;
+        count_+=dataSize;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+    
+}
+  
+
+#endif
Index: /XIOS/trunk/src/buffer_pair.cpp
===================================================================
--- /XIOS/trunk/src/buffer_pair.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_pair.cpp	(revision 306)
@@ -0,0 +1,87 @@
+#include "buffer_pair.hpp"
+
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CBufferPair::CBufferPair(MPI_Comm com_client_server)
+         : com_client_server(com_client_server) 
+         , first(BUFFER_CLIENT_SIZE), second(BUFFER_CLIENT_SIZE)
+         , first_request(MPI_REQUEST_NULL), second_request(MPI_REQUEST_NULL)
+         , currentBuffer(0)
+      { /* Ne rien faire de plus */ }
+
+      CBufferPair::~CBufferPair(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      bool CBufferPair::mustBeSent(void)
+      {
+         if ((currentBuffer  ==  0) && (first.getUsedSize()  != 0) &&
+            ((second_request == MPI_REQUEST_NULL) || CMPIManager::Test (second_request)))
+             return (true);
+             
+         if ((currentBuffer  ==  1) && (second.getUsedSize() != 0) &&
+            ((first_request  == MPI_REQUEST_NULL) || CMPIManager::Test (first_request)))
+            return (true);
+            
+         return (false);
+      }
+      
+      //---------------------------------------------------------------
+      
+      MPI_Request CBufferPair::wait(void)
+      {
+         if (this->currentBuffer == 0)
+         {
+            CMPIManager::Wait(this->second_request);
+            this->second_request = MPI_REQUEST_NULL;
+            return (this->second_request);
+         }
+         else
+         {
+            CMPIManager::Wait(this->first_request);
+            this->first_request = MPI_REQUEST_NULL;
+            return (this->first_request);
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CBufferPair::sendCurrentBuffer(void)
+      {
+         if (this->currentBuffer == 0)
+         {
+            CMPIManager::SendLinearBuffer
+               (this->com_client_server, 0, this->first, this->first_request);
+            this->currentBuffer  =  1;
+            this->second_request = MPI_REQUEST_NULL;
+            this->second.clear();
+         }
+         else  if(this->currentBuffer == 1)
+         {
+            CMPIManager::SendLinearBuffer
+               (this->com_client_server, 0, this->second, this->second_request);
+            this->currentBuffer =  0;
+            this->first_request = MPI_REQUEST_NULL;
+            this->first.clear();
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      CLinearBuffer & CBufferPair::getCurrentBuffer(void)
+      {
+         if (currentBuffer == 0) return (this->first);
+         return (this->second);
+      }
+      
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/buffer_pair.hpp
===================================================================
--- /XIOS/trunk/src/buffer_pair.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_pair.hpp	(revision 306)
@@ -0,0 +1,103 @@
+#ifndef __XMLIO_CBufferPair__
+#define __XMLIO_CBufferPair__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBufferPair
+      {
+
+            /// DÃ©finition de type ///
+            typedef CLinearBuffer BufferType;
+
+         public :
+
+            /// Construteurs ///
+            CBufferPair(MPI_Comm com_client_server = CMPIManager::GetCommWorld());
+            CBufferPair(const CBufferPair & buffer_pair);       // Not implemented yet.
+            CBufferPair(const CBufferPair * const buffer_pair); // Not implemented yet.
+
+            template <typename A1, typename A2, typename A3, typename A4>
+               void prepareRequest(const long int & managerId,
+                                   const long int & methodId,
+                                   A1 * arg1 = CLinearBuffer::NULL_ARG,
+                                   A2 * arg2 = CLinearBuffer::NULL_ARG,
+                                   A3 * arg3 = CLinearBuffer::NULL_ARG,
+                                   A4 * arg4 = CLinearBuffer::NULL_ARG);
+            /// Accesseur ///    
+            CLinearBuffer & getCurrentBuffer(void);
+            
+            /// Traitements divers ///
+            MPI_Request wait(void);
+            void sendCurrentBuffer(void); 
+                        
+            /// Destructeur ///
+            virtual ~CBufferPair(void);
+            
+         protected :
+            
+            /// Test ///
+            bool mustBeSent(void);           
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            MPI_Comm com_client_server;
+            CLinearBuffer first, second;
+            MPI_Request first_request, second_request;
+            int currentBuffer;
+
+      }; // class CBufferPair
+      
+      ///--------------------------------------------------------------
+      
+      template <typename A1, typename A2, typename A3, typename A4>
+         void CBufferPair::prepareRequest(const long int & managerId,
+                                          const long int & methodId,
+                                          A1 * arg1, A2 * arg2, A3 * arg3, A4 * arg4)
+      {       
+         if (this->mustBeSent()) 
+            this->sendCurrentBuffer();
+           
+         CLinearBuffer & cbuffer = this->getCurrentBuffer();
+         StdSize usize = cbuffer.getUnusedSize();         
+         StdSize rsize = cbuffer.getRequestedSize(arg1, arg2, arg3, arg4) ;
+         StdSize msize = cbuffer.getSize();
+         
+         long int nbargs = 0;
+         
+         if (arg1 != NULL) nbargs++;
+         if (arg2 != NULL) nbargs++;
+         if (arg3 != NULL) nbargs++;
+         if (arg4 != NULL) nbargs++;
+         
+         if (rsize > msize)
+            ERROR("CBufferPair::sendRequest(...)", << "Le tampon client est trop petit !");
+                  
+         if (rsize <= usize)
+         {
+            cbuffer.appendRequestInfos(managerId, methodId, nbargs);
+         }
+         else
+         {
+            this->wait();
+            this->prepareRequest(managerId, methodId, arg1, arg2, arg3, arg4);
+         }
+      }
+      
+      ///--------------------------------------------------------------
+      
+      
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBufferPair__
Index: /XIOS/trunk/src/buffer_server.cpp
===================================================================
--- /XIOS/trunk/src/buffer_server.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_server.cpp	(revision 306)
@@ -0,0 +1,172 @@
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_server.hpp"
+
+namespace xmlioserver
+{
+  size_t CServerBuffer::bufferSizeByClient=100*1024*1024 ;
+//  size_t CServerBuffer::bufferSizeByClient=20*1024 ;
+
+  CServerBuffer::CServerBuffer(void)
+  {
+    size=bufferSizeByClient ;
+    first=0 ;
+    current=1 ;
+    end=size ;
+    buffer=new char[size] ;  // change later for MPI_ALLOC_MEM later
+  }
+
+  CServerBuffer::~CServerBuffer()
+  {
+    delete [] buffer ;
+  }
+  
+
+  bool CServerBuffer::isBufferFree(size_t count)
+  {
+    bool ret ;
+    
+    if (count==0) return true ;
+    
+    if (current>first)
+    {
+      if (current+count<size)
+      {
+        ret=true ;
+      }
+      else if (current+count==size)
+      {
+        if (first>0)
+        {
+          ret=true ;
+        }
+        else
+        {
+          ret=false ;
+        }
+      }
+      else
+      {
+        if (count<first)
+        {
+          ret=true ;
+        }
+        else
+        {
+          ret=false ;
+        }
+      }
+    }
+    else
+    {
+      if (current+count<first)
+      {
+        ret=true ;
+      }
+      else
+      {
+         ret=false ;
+      }
+    }
+
+    return ret ;
+  }
+  
+
+  void* CServerBuffer::getBuffer(size_t count)
+  {
+    char* ret ;
+    
+    if (count==0) return buffer+current ;
+    
+    if (current>first)
+    {
+      if (current+count<size)
+      {
+        ret=buffer+current ;
+        current+=count ;
+      }
+      else if (current+count==size)
+      {
+        if (first>0)
+        {
+          ret=buffer+current ;
+          current=0 ;
+        }
+        else
+        {
+          ERROR("void* CServerBuffer::getBuffer(size_t count)",
+                 <<"cannot allocate required size in buffer") ;
+        }
+      }
+      else
+      {
+        end=current ;
+        if (count<first)
+        {
+          ret=buffer ;
+          current=count ;
+        }
+        else
+        {
+          ERROR("void* CServerBuffer::getBuffer(size_t count)",
+                 <<"cannot allocate required size in buffer") ;
+        }
+      }
+    }
+    else
+    {
+      if (current+count<first)
+      {
+        ret=buffer+current ;
+        current+=count ;
+      }
+      else
+      {
+          ERROR("void* CServerBuffer::getBuffer(size_t count)",
+                 <<"cannot allocate required size in buffer") ;
+      }
+    }
+
+    return ret ;
+  }
+  
+  void CServerBuffer::freeBuffer(size_t count)
+  {
+    if (count==0) return ;
+
+    if (first==end-1) 
+    {
+      first=0 ;
+      count-- ;
+      end=size ;
+    }
+
+    if (first<=current)
+    {
+      if (first+count <current) 
+      {
+        first+=count ;
+      }
+      else
+      {
+          ERROR("void CServerBuffer::freeBuffer(size_t count)",
+                 <<"cannot free required size in buffer") ;
+      }
+    
+    }
+    else
+    {
+      if (first+count<end)
+      {
+        first+=count ;
+      }
+      else
+      {
+          ERROR("void CServerBuffer::freeBuffer(size_t count)",
+                 <<"cannot free required size in buffer") ;
+      }
+    }
+  }      
+       
+}
Index: /XIOS/trunk/src/buffer_server.hpp
===================================================================
--- /XIOS/trunk/src/buffer_server.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_server.hpp	(revision 306)
@@ -0,0 +1,34 @@
+#ifndef __BUFFER_SERVER_HPP__
+#define __BUFFER_SERVER_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "buffer_ym.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+
+  class CServerBuffer
+  {
+    
+    public:
+    
+    CServerBuffer(void) ;
+    ~CServerBuffer() ;
+    char* buffer ;
+    
+    bool isBufferFree(size_t count) ;
+    void* getBuffer(size_t count) ;
+    void freeBuffer(size_t count) ;
+  
+    size_t first ;   // first occupied element
+    size_t current ; // first free element
+    size_t end ;
+    size_t size ;
+    static size_t bufferSizeByClient ;
+  } ;
+  
+
+}
+
+#endif
Index: /XIOS/trunk/src/buffer_ym.cpp
===================================================================
--- /XIOS/trunk/src/buffer_ym.cpp	(revision 306)
+++ /XIOS/trunk/src/buffer_ym.cpp	(revision 306)
@@ -0,0 +1,52 @@
+#include "xmlioserver_spl.hpp"
+#include "buffer_ym.hpp"
+
+
+namespace xmlioserver
+{
+  namespace ym
+  {
+    CBuffer::CBuffer(void* buffer_,size_t size_)
+    {
+      own=false ;
+      realloc(buffer_,size_) ;
+    }
+    
+    CBuffer::CBuffer(size_t size_)
+    {
+      own=false ;
+      realloc(size_) ;
+    }
+
+    void CBuffer::realloc(size_t size_)
+    {
+      realloc(new char[size_],size_) ;
+      own=true ;
+    }
+
+    void CBuffer::realloc(void* buffer_,size_t size_)
+    {
+      if (own) delete [] buffer ;
+      buffer=(char*)buffer_ ;
+      size=size_ ;
+      count=0 ;
+      read=buffer ;
+      write=buffer ;
+      own=false ;
+    }
+
+    size_t CBuffer::remain(void)
+    {
+      return size-count ;
+    }    
+    
+    CBuffer::~CBuffer()
+    {
+      if (own) delete [] buffer ;
+    }
+    
+  }
+}
+    
+      
+    
Index: /XIOS/trunk/src/buffer_ym.hpp
===================================================================
--- /XIOS/trunk/src/buffer_ym.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_ym.hpp	(revision 306)
@@ -0,0 +1,81 @@
+#ifndef __BUFFER_YM_HPP__
+#define __BUFFER_YM_HPP__
+
+
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+  namespace ym
+  {
+  
+    class CBuffer
+    {
+    
+      public:
+      
+      CBuffer(size_t size) ;
+      CBuffer(void* buffer,size_t size) ;
+
+      void realloc(size_t size) ;
+      void realloc(void* buffer,size_t size) ;
+      
+      template<class T>
+      bool put(const T& data) ;
+
+      template<class T>
+      bool put(const T* data, size_t n) ;
+
+      template<class T>
+      bool put_ptr(const T*& data_ptr, size_t n) ;
+      
+      template<class T>
+      bool get(T& data) ;
+
+      template<class T>
+      bool get(T* data, size_t n) ;
+
+      template<class T>
+      bool get_ptr(T*& data, size_t n) ;
+
+      
+ 
+      template<class T>
+      bool put_template(const T& data) ;
+
+      template<class T>
+      bool put_template(const T* data, size_t n) ;
+
+      template<class T>
+      bool put_ptr_template(const T*& data, size_t n) ;
+      
+      template<class T>
+      bool get_template(T& data) ;
+
+      template<class T>
+      bool get_template(T* data, size_t n) ;
+
+      template<class T>
+      bool get_ptr_template(T*& data, size_t n) ;
+      
+      size_t remain(void) ;
+                            
+      ~CBuffer() ;
+       char* buffer ;
+       char* read ;
+       char* write ;
+       size_t count ;
+       bool own ; 
+       size_t size ;   
+    } ;
+    
+    
+  
+ 
+  }
+}
+
+#include "buffer_ym_impl.hpp" 
+
+
+#endif
Index: /XIOS/trunk/src/buffer_ym_impl.hpp
===================================================================
--- /XIOS/trunk/src/buffer_ym_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/buffer_ym_impl.hpp	(revision 306)
@@ -0,0 +1,178 @@
+#ifndef __BUFFER_YM_IMPL_HPP__
+#define __BUFFER_YM_IMPL_HPP__
+
+namespace xmlioserver
+{
+  namespace ym
+  {
+
+// template spectialisation : CBuffer::put
+    template <> bool CBuffer::put<char>(const char& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<int>(const int& data)   { return put_template(data) ; }
+    template <> bool CBuffer::put<short>(const short& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<long>(const long& data)  { return put_template(data) ; }  
+    template <> bool CBuffer::put<uint>(const uint& data)  { return put_template(data) ; }  
+    template <> bool CBuffer::put<ushort>(const ushort& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<ulong>(const ulong& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<float>(const float& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<double>(const double& data) { return put_template(data) ; }  
+    template <> bool CBuffer::put<long double>(const long double& data) { return put_template(data) ;}  
+
+    template <> bool CBuffer::put<char>(const char* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<int>(const int* data, size_t n)   { return put_template(data,n) ; }
+    template <> bool CBuffer::put<short>(const short* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<long>(const long* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<uint>(const uint* data, size_t n)  { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<ushort>(const ushort* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<ulong>(const ulong* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<float>(const float* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<double>(const double* data, size_t n) { return put_template(data,n) ; }  
+    template <> bool CBuffer::put<long double>(const long double* data, size_t n) { return put_template(data,n) ;}  
+
+
+    template <> bool CBuffer::put_ptr<char>(const char*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<int>(const int*& data, size_t n)   { return put_ptr_template(data,n) ; }
+    template <> bool CBuffer::put_ptr<short>(const short*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<long>(const long*& data, size_t n)  { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<uint>(const uint*& data, size_t n)  { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<ushort>(const ushort*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<ulong>(const ulong*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<float>(const float*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<double>(const double*& data, size_t n) { return put_ptr_template(data,n) ; }  
+    template <> bool CBuffer::put_ptr<long double>(const long double*& data, size_t n) { return put_ptr_template(data,n) ;}  
+
+
+// template spectialisation : CBuffer::get
+    template <> bool CBuffer::get<char>(char& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<int>(int& data)   { return get_template(data) ; }
+    template <> bool CBuffer::get<short>(short& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<long>(long& data)  { return get_template(data) ; }  
+    template <> bool CBuffer::get<uint>(uint& data)  { return get_template(data) ; }  
+    template <> bool CBuffer::get<ushort>(ushort& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<ulong>(ulong& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<float>(float& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<double>(double& data) { return get_template(data) ; }  
+    template <> bool CBuffer::get<long double>(long double& data) { return get_template(data) ;}  
+
+    template <> bool CBuffer::get<char>(char* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<int>(int* data, size_t n)   { return get_template(data,n) ; }
+    template <> bool CBuffer::get<short>(short* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<long>(long* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<uint>(uint* data, size_t n)  { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<ushort>(ushort* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<ulong>(ulong* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<float>(float* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<double>(double* data, size_t n) { return get_template(data,n) ; }  
+    template <> bool CBuffer::get<long double>(long double* data, size_t n) { return get_template(data,n) ;}  
+
+    template <> bool CBuffer::get_ptr<char>(char*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<int>(int*& data, size_t n)   { return get_ptr_template(data,n) ; }
+    template <> bool CBuffer::get_ptr<short>(short*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<long>(long*& data, size_t n)  { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<uint>(uint*& data, size_t n)  { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<ushort>(ushort*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<ulong>(ulong*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<float>(float*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<double>(double*& data, size_t n) { return get_ptr_template(data,n) ; }  
+    template <> bool CBuffer::get_ptr<long double>(long double*& data, size_t n) { return get_ptr_template(data,n) ;}  
+    
+    
+    template <class T>
+    bool CBuffer::put_template(const T& data)
+    {
+      return put_template<T>(&data,1);
+    }
+    
+    template <class T>
+    bool CBuffer::put_template(const T* data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count+dataSize<=size)
+      {
+        dataBuff=(char*) data ;
+        for(size_t i=0;i<dataSize;i++) write[i]=dataBuff[i] ;
+        write+=dataSize ;
+        count+=dataSize;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+
+    template <class T>
+    bool CBuffer::put_ptr_template(const T*& data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (count+dataSize<=size)
+      {
+        data=(T*) write ;
+        write+=dataSize ;
+        count+=dataSize;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+
+
+    template <class T>
+    bool CBuffer::get_template(T& data)
+    {
+      return get_template<T>(&data,1) ;
+      
+    }
+        
+    template <class T>
+    bool CBuffer::get_template(T* data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (read+dataSize<=buffer+size)
+      {
+        dataBuff=(char*) data ;
+        for(size_t i=0;i<dataSize;i++) dataBuff[i]=read[i] ;
+        read+=dataSize ;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }
+
+    template <class T>
+    bool CBuffer::get_ptr_template(T*& data, size_t n)
+    {
+      bool ret;
+      char* dataBuff ;
+  
+      size_t dataSize=sizeof(T)*n ;
+  
+      if (read+dataSize<=buffer+size)
+      {
+        data=(T*) read ;
+        read+=dataSize ;
+        ret=true ;
+      }
+      else ret=false ;
+  
+      return ret ;
+    }    
+
+  }
+}
+  
+
+#endif
Index: /XIOS/trunk/src/calendar.cpp
===================================================================
--- /XIOS/trunk/src/calendar.cpp	(revision 306)
+++ /XIOS/trunk/src/calendar.cpp	(revision 306)
@@ -0,0 +1,108 @@
+#include "calendar.hpp"
+#include "duration.hpp"
+#include "date.hpp"
+#include "calendar_util.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CCalendar::CCalendar(void)
+         : CObject()
+         , initDate(*this)
+         , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::CCalendar(const StdString & id,
+                           int yr, int mth, int d  ,
+                           int hr, int min, int sec)
+               : CObject(id)
+               , initDate(*this, yr, mth, d, hr, min, sec)
+               , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::CCalendar(const StdString & id, const StdString & dateStr)
+               : CObject(id)
+               , initDate(CDate::FromString(dateStr, *this))
+               , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::~CCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      StdString CCalendar::toString(void) const
+      {
+         StdOStringStream oss;
+         oss <<   "[type: "   << this->getId()
+             << ", start: "   << this->initDate
+             << ", current: " << this->currentDate << "]";
+         return (oss.str());
+      }
+
+      void CCalendar::fromString(const StdString & str)
+      { ERROR("CCalendar::fromString(str)",
+               << "[ str = " << str << "] Not implemented yet !"); }
+
+      //-----------------------------------------------------------------
+
+      void CCalendar::setTimeStep(const CDuration & duration)
+      { this->timestep = duration; }
+
+      CDate & CCalendar::update(int step)
+      { 
+         info(20) << "update step : " << step <<" timestep "<<this->timestep << std::endl;
+         return (this->getCurrentDate() = this->getInitDate() + step * this->timestep);
+      }
+
+      //-----------------------------------------------------------------
+
+      const CDuration & CCalendar::getTimeStep(void) const { return (this->timestep); }
+      const CDate & CCalendar::getInitDate(void) const     { return (this->initDate); }
+      CDate & CCalendar::getCurrentDate(void)              { return (this->currentDate); }
+
+      //-----------------------------------------------------------------
+
+      int CCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         static const int NoLeapMonthLength[] =
+            {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+         return (NoLeapMonthLength[date.getMonth()-1]);
+      }
+
+      StdString CCalendar::getType(void) const { return (StdString(this->getId())); }
+
+      int CCalendar::getYearTotalLength(const CDate & date) const { return (365 * 86400); }
+
+      int CCalendar::getYearLength  (void) const { return (12); }
+      int CCalendar::getDayLength   (void) const { return (24); }
+      int CCalendar::getHourLength  (void) const { return (60); }
+      int CCalendar::getMinuteLength(void) const { return (60); }
+
+      int CCalendar::getNbSecond(const CDate & date) const
+      { // Retourne le nombre de secondes Ã©coulÃ©es depuis le dÃ©but de l'annÃ©e.
+         CDate _d0(date); int  nbday = 0;
+
+         for(_d0.setMonth(1); _d0.getMonth() < date.getMonth(); _d0.setMonth(_d0.getMonth()+1))
+            nbday += getMonthLength(_d0);
+         return ((((nbday + date.getDay()) * getDayLength() + date.getHour()) * getHourLength()
+                     + date.getMinute()) * getMinuteLength() + date.getSecond());
+      }
+
+      StdString CCalendar::getMonthName(int month_id) const
+      {
+         static const StdString Monthname_str[] =
+            { "january", "february", "march"    , "april"  , "may"     , "june"    ,
+              "july"   , "august"  , "september", "october", "november", "december" };
+         return(Monthname_str[month_id-1]);
+      }
+
+      const StdString CCalendar::getMonthShortName(int month_id) const
+      { StdString value = this->getMonthName(month_id); value.resize(3); return (value); }
+
+      ///----------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
Index: /XIOS/trunk/src/calendar.hpp
===================================================================
--- /XIOS/trunk/src/calendar.hpp	(revision 306)
+++ /XIOS/trunk/src/calendar.hpp	(revision 306)
@@ -0,0 +1,96 @@
+#ifndef __XMLIO_CCalendar__
+#define __XMLIO_CCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "date.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      typedef enum _monthEnum
+      {  JAN = 1, FEB = 2, MAR = 3, APR = 4 , MAY = 5 , JUN = 6 ,
+         JUL = 7, AUG = 8, SEP = 9, OCT = 10, NOV = 11, DEC = 12  } MonthEnum;
+
+      ///---------------------------------------------------------------
+
+      class CDate;
+
+      class CCalendar : public CObject
+      {
+            /// Typedef ///
+            typedef CObject SuperClass;
+
+         public :
+
+            /// Destructeur ///
+            virtual ~CCalendar(void);
+
+         protected :
+
+            /// Constructeurs ///
+            CCalendar(void);
+            CCalendar(const StdString & id,
+                      int yr = 0, int mth = 1, int d   = 1,
+                      int hr = 0, int min = 0, int sec = 0);
+            CCalendar(const StdString & id, const StdString & dateStr);
+            CCalendar(const CCalendar & calendar);       // Not implemented yet.
+            CCalendar(const CCalendar * const calendar); // Not implemented yet.
+
+         public :
+
+            //------------------------------------------------------------
+
+            /// Autres ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+            /// Mutateur ///
+            void setTimeStep(const CDuration & duration);
+
+            /// Traitemants ///
+            CDate & update(int step);
+
+            /// Accesseurs ///
+            const CDuration & getTimeStep(void) const;
+            const CDate & getInitDate(void) const;
+            CDate & getCurrentDate(void);
+            
+         public :
+         
+            //------------------------------------------------------------
+            virtual int getMonthLength(const CDate & date) const;
+
+            virtual StdString getType(void) const;
+
+            virtual int getYearTotalLength(const CDate & date) const ; // Retourne la durÃ©e d'une annÃ©e en seconde.
+
+            virtual int getYearLength  (void) const; // Retourne la durÃ©e d'une annÃ©e en mois.
+            virtual int getDayLength   (void) const; // Retourne la durÃ©e d'un jour en heures.
+            virtual int getHourLength  (void) const; // Retourne la durÃ©e d'une heure en minute.
+            virtual int getMinuteLength(void) const; // Retourne la durÃ©e d'une minute en secondes.
+
+            virtual int getNbSecond(const CDate & date) const;
+            virtual StdString getMonthName(int month_id) const;
+
+            virtual const StdString getMonthShortName(int month_id) const;
+
+            //------------------------------------------------------------
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            const CDate initDate;
+            CDate currentDate;
+            CDuration timestep;
+
+      }; // class CCalendar
+   } // namespace date
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CCalendar__
Index: /XIOS/trunk/src/calendar_util.cpp
===================================================================
--- /XIOS/trunk/src/calendar_util.cpp	(revision 306)
+++ /XIOS/trunk/src/calendar_util.cpp	(revision 306)
@@ -0,0 +1,180 @@
+#include "calendar_util.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CDuration operator*(const double & scal, const CDuration & ddr)
+      { return (ddr * scal); }
+
+      CDuration operator-(const CDuration & ddr , const CDuration & dr)
+      {
+         CDuration dur(ddr);
+         dur.year -= dr.year;  dur.month  -= dr.month ; dur.day    -= dr.day;
+         dur.hour -= dr.hour;  dur.minute -= dr.minute; dur.second -= dr.second;
+         return (dur);
+      }
+
+      CDuration operator+(const CDuration & ddr , const CDuration & dr)
+      {
+         CDuration dur(ddr);
+         dur.year += dr.year;  dur.month  += dr.month ; dur.day    += dr.day;
+         dur.hour += dr.hour;  dur.minute += dr.minute; dur.second += dr.second;
+         return (dur);
+      }
+
+      CDuration operator*(const CDuration & ddr , const double & scal)
+      {
+         CDuration dur(ddr);
+         dur.year *= scal;  dur.month  *= scal; dur.day    *= scal;
+         dur.hour *= scal;  dur.minute *= scal; dur.second *= scal;
+         return (dur);
+      }
+
+      CDuration operator-(const CDuration & ddr)
+      {
+         CDuration dur(ddr);
+         dur.year   = -dur.year;
+         dur.month  = -dur.month;
+         dur.day    = -dur.day;
+         dur.hour   = -dur.hour;
+         dur.minute = -dur.minute;
+         dur.second = -dur.second;
+         return (dur);
+      }
+
+      //-----------------------------------------------------------------
+
+      CDate operator+(const CDate & dt, const CDuration & dr)
+      {
+         CDuration drr (dr);
+         int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
+         const CCalendar & c = dt.getRelCalendar();
+
+         drr.resolve(dt.getRelCalendar());
+
+         // Ajustement des minutes par rapport aux secondes.
+         second += dt.getSecond() + drr.second;
+         if (second <  0) { minute --; second += c.getMinuteLength(); }
+         if (second >= c.getMinuteLength()) { minute ++; second -= c.getMinuteLength(); }
+
+         // Ajustement des heures en fonction des minutes.
+         minute += dt.getMinute() + drr.minute;
+         if (minute < 0) { hour --; minute += c.getHourLength(); }
+         if (minute >= c.getHourLength()) { hour ++; minute -= c.getHourLength(); }
+
+         // Ajustement des jours en fonction des heures.
+         hour += dt.getHour() + drr.hour;
+         if (hour <  0) { drr.day --; hour += c.getDayLength(); }
+         if (hour >= c.getDayLength()) { drr.day ++; hour -= c.getDayLength(); }
+
+         // Ajustement des mois en fonction des jours.
+         int signVal = (drr.day != 0) ? drr.day/fabs(drr.day) : 0;
+         CDate dtt(dt); dtt.addMonth (signVal);
+
+         for(; c.getMonthLength(dtt) < fabs(drr.day); dtt.addMonth (signVal))
+         { drr.day -= signVal * c.getMonthLength(dtt); drr.month += signVal; }
+
+         day += dt.getDay() + drr.day;
+         if (day <  0) { drr.month --; day += c.getMonthLength(dtt); }
+         if (day >= c.getMonthLength(dtt)) { drr.month ++; day -= c.getMonthLength(dtt); } // << ProblÃšme ici
+         if (day == 0){ day = c.getMonthLength(dtt); drr.month --; }
+         
+         drr.resolve(dt.getRelCalendar());
+
+         // Ajustement des annÃ©es en fonction des mois.
+         month += dt.getMonth() + drr.month;
+         if (month <  0) { drr.year --; month += c.getYearLength(); }
+         if (month >  c.getYearLength()) { drr.year ++; month -= c.getYearLength(); }
+         if (month == 0){ month = c.getYearLength(); drr.year--; }
+
+         year += dt.getYear() + drr.year;
+
+         return (CDate(dt.getRelCalendar(), year, month, day, hour, minute, second));
+      }
+
+      CDate operator-(const CDate & dt, const CDuration & dr) { return (dt + (-dr)); }
+
+      //-----------------------------------------------------------------
+
+      CDuration operator-(const CDate & dt0, const CDate & dt1)
+      {
+         // 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() };
+         return (dur.resolve(dt0.getRelCalendar()));
+      }
+
+      //-----------------------------------------------------------------
+
+      /// Les opÃ©rateurs de comparaison. (Non testÃ©s pour le moment)
+      bool operator==(const CDate& dt0, const CDate& dt1)
+      {
+         // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
+         return ((dt0.getYear() == dt1.getYear()) && (dt0.getMonth()  == dt1.getMonth())  && (dt1.getDay()    == dt0.getDay()) &&
+                 (dt0.getHour() == dt1.getHour()) && (dt0.getMinute() == dt1.getMinute()) && (dt1.getSecond() == dt0.getSecond()));
+      }
+
+      bool operator< (const CDate& dt0, const CDate& dt1)
+      {
+         // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
+         if   (dt0.getYear()  < dt1.getYear())
+         { 
+            return true;
+         }
+         else if (dt0.getYear() == dt1.getYear())
+         { 
+            if   (dt0.getMonth()  < dt1.getMonth())
+            {
+               return true;
+            }
+            else if (dt0.getMonth() == dt1.getMonth())
+            {
+               if   (dt0.getDay()  < dt1.getDay())
+               {
+                   return true;
+               }
+               else if (dt0.getDay() == dt1.getDay())
+               {
+                  if    (dt0.getHour()  < dt1.getHour())
+                  {
+                     return true;
+                  }
+                  else if (dt0.getHour() == dt1.getHour())
+                  { 
+                     if   (dt0.getMinute()  < dt1.getMinute())
+                     {
+                        return true;
+                     }
+                     else if (dt0.getMinute() == dt1.getMinute())
+                     {
+                        if (dt0.getSecond() < dt1.getSecond())
+                           return true;
+                     }
+                  }
+               }
+            }
+         }
+         return false;
+      }
+
+      //-----------------------------------------------------------------
+
+      bool operator!=(const CDate & dt0, const CDate & dt1){ return !(dt1 == dt0); }
+      bool operator> (const CDate & dt0, const CDate & dt1){ return (dt1 < dt0); }
+      bool operator>=(const CDate & dt0, const CDate & dt1){ return ((dt0 > dt1) || (dt1 == dt0)); }
+      bool operator<=(const CDate & dt0, const CDate & dt1){ return ((dt0 < dt1) || (dt1 == dt0)); }
+
+      ///----------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+
+
+
+
+
Index: /XIOS/trunk/src/calendar_util.hpp
===================================================================
--- /XIOS/trunk/src/calendar_util.hpp	(revision 306)
+++ /XIOS/trunk/src/calendar_util.hpp	(revision 306)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CCalendar_util__
+#define __XMLIO_CCalendar_util__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      CDuration operator*(const double    & scal, const CDuration & ddr);
+      CDuration operator-(const CDuration & ddr , const CDuration & dr);
+      CDuration operator+(const CDuration & ddr , const CDuration & dr);
+      CDuration operator*(const CDuration & ddr , const double    & scal);
+      CDuration operator-(const CDuration & ddr);
+
+      CDate operator+(const CDate & dt, const CDuration & dr); // Non testÃ©e.
+      CDate operator-(const CDate & dt, const CDuration & dr);
+
+      CDuration operator-(const CDate & dt0, const CDate & dt1);
+
+      /// Les opÃ©rateurs de comparaison. (Non testÃ©s pour le moment)
+      bool operator==(const CDate& dt0, const CDate& dt1);
+      bool operator< (const CDate& dt0, const CDate& dt1);
+
+      bool operator!=(const CDate & dt0, const CDate & dt1);
+      bool operator> (const CDate & dt0, const CDate & dt1);
+      bool operator>=(const CDate & dt0, const CDate & dt1);
+      bool operator<=(const CDate & dt0, const CDate & dt1);
+
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif //__XMLIO_CCalendar_util__
Index: /XIOS/trunk/src/circular_buffer.cpp
===================================================================
--- /XIOS/trunk/src/circular_buffer.cpp	(revision 306)
+++ /XIOS/trunk/src/circular_buffer.cpp	(revision 306)
@@ -0,0 +1,260 @@
+#include "circular_buffer.hpp"
+
+#include "linear_buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CCircularBuffer::CCircularBuffer(StdSize size)
+         : SuperClass(size)
+         , p_write(0), p_read(0), p_unused(0)
+         , nbrequest(0)
+      { /* Ne rien faire de plus */ }
+
+      CCircularBuffer::CCircularBuffer(const CCircularBuffer & cbuffer)
+         : SuperClass(cbuffer)
+         , p_write(cbuffer.p_write), p_read(cbuffer.p_read), p_unused(cbuffer.p_unused)
+         , nbrequest(cbuffer.nbrequest)
+      { /* Ne rien faire de plus */ }
+      
+      CCircularBuffer::CCircularBuffer(const CCircularBuffer * const cbuffer)
+         : SuperClass(cbuffer)
+         , p_write(cbuffer->p_write), p_read(cbuffer->p_read), p_unused(cbuffer->p_unused)
+         , nbrequest(cbuffer->nbrequest)
+      { /* Ne rien faire de plus */ }
+
+      CCircularBuffer::~CCircularBuffer(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      void CCircularBuffer::clear(void)
+      {
+         this-> p_write  = 0;
+         this-> p_read   = 0;
+         this-> p_unused = 0;
+      }
+
+      //-------------------------------------------------------------
+
+      StdSize CCircularBuffer::getNextRequestSize(void) const
+      {
+         if (!this->hasRequest())
+            ERROR("CCircularBuffer::getNextRequestSize()",
+                  << " invalid call !");
+         long int nbargs  = 0;
+         StdSize startpos = this-> p_read;
+         StdSize currsize = 2 * SuperClass::getRequestedSize(nbargs);
+         nbargs    = SuperClass::getInt(startpos + currsize);
+         currsize += SuperClass::getRequestedSize(nbargs);
+         
+         for (long int i = 0; i < nbargs; i++)
+         {
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, startpos + currsize);
+            currsize += (bufdata.size + DATA_HEADER_SIZE);
+         }
+         return (currsize);
+      }
+      
+      //-------------------------------------------------------------
+      
+      CLinearBuffer CCircularBuffer::getNextRequest(void)
+      {
+         StdSize startpos = this-> p_read;
+         StdSize currsize = this->getNextRequestSize();
+        
+         this->movePRead(currsize);
+         this->nbrequest--;
+        
+         return (CLinearBuffer(SuperClass::getData(startpos), currsize));
+      }
+
+      //-------------------------------------------------------------
+
+      void CCircularBuffer::appendRequest(const CLinearBuffer & brequest)
+      {
+         StdSize usedsize   = brequest.getUsedSize();
+         if (!this->isAvailable(usedsize))
+            ERROR("CCircularBuffer::appendRequest(brequest)",
+                  << " invalid call !");
+         StdSize data_begin = this->prepareNextDataPosition(usedsize);
+         SuperClass::setData(brequest.getData(), usedsize, data_begin);
+         this->updateNbRequests(data_begin, data_begin + usedsize);
+      }
+
+      //-------------------------------------------------------------
+
+      char * CCircularBuffer::prepareNextData(StdSize data_size)
+      {
+         return (SuperClass::getData(this->prepareNextDataPosition(data_size)));
+      }
+      
+      //-------------------------------------------------------------
+
+      StdSize CCircularBuffer::prepareNextDataPosition(StdSize data_size)
+      {
+         StdSize startpos = this-> p_write;
+         if (!this->isAvailable(data_size))
+            ERROR("CCircularBuffer::prepareNextDataPosition(data_size)",
+                  << " invalid call !");
+         if ((this-> p_write + data_size) > SuperClass::getSize())
+            startpos = 0;
+
+         this->movePWrite(data_size);
+         return (startpos);
+      }
+
+      //-------------------------------------------------------------
+
+      void CCircularBuffer::movePRead(StdSize data_size)
+      {
+         this-> p_read += data_size;
+         if ((this-> p_read == this-> p_unused) &&
+             (this-> p_read == this-> p_write))
+         {
+            this->clear();
+            return;
+         }
+         
+         if (this-> p_read == this-> p_unused)
+         {
+            this-> p_unused = this-> p_write;
+            this-> p_read   = 0;
+            return;
+         }
+         if (this-> p_read == this-> p_write)
+         {
+            this->clear();
+         }
+      }
+      
+      //-------------------------------------------------------------
+      
+      void CCircularBuffer::movePWrite(StdSize data_size)
+      {
+         if ((this-> p_write + data_size) > SuperClass::getSize())
+         {
+            this-> p_unused = this-> p_write;
+            this-> p_write  = data_size;
+            if (this-> p_read < (data_size))
+               ERROR("CCircularBuffer::movePWrite(data_size)",
+                     << " invalid position 1 !");
+         }
+         else
+         {
+            if ((this-> p_read > this-> p_write) &&
+                (this-> p_read < (this-> p_write + data_size)))
+               ERROR("CCircularBuffer::movePWrite(data_size)",
+                     << " invalid position 2 !");
+            this-> p_write += data_size;
+            if (this->p_read < this->p_write)
+               this-> p_unused = this-> p_write;
+         }
+      }
+
+      //-------------------------------------------------------------
+
+      bool CCircularBuffer::hasRequest(void) const
+      { 
+         return (this->nbrequest != 0); 
+      }
+      
+      //-------------------------------------------------------------
+      
+      bool CCircularBuffer::isAvailable(StdSize data_size) const
+      {
+         if (this->p_write == this->p_unused)
+            return (((SuperClass::getSize() - this->p_write) >= data_size) ||
+                   (this->p_read >= data_size));
+         else
+            return ((this->p_read - this->p_write) >= data_size);
+      }
+      //---------------------------------------------------------------
+
+      void CCircularBuffer::printToTextFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToTextStream(ofs);
+         ofs.close();
+      }
+      
+      //-------------------------------------------------------------
+      
+      void CCircularBuffer::printToTextStream (StdOStream & ostr)
+      {
+         StdSize _p_write   = p_write,
+                 _p_read    = p_read,
+                 _p_unused  = p_unused,
+                 _nbrequest = nbrequest;
+
+         while (this->hasRequest())
+         {
+            this->getNextRequest().printToTextStream(ostr);
+            ostr << std::endl;
+         }
+
+         p_write   = _p_write;
+         p_read    = _p_read;
+         p_unused  = _p_unused;
+         nbrequest = _nbrequest;
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CCircularBuffer::getNumberOfRequest(void) const
+      { 
+         return (this->nbrequest); 
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CCircularBuffer::getReadPosition(void) const
+      { 
+         return (this->p_read); 
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CCircularBuffer::getWritePosition(void) const
+      { 
+         return (this->p_write); 
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CCircularBuffer::getUnusedPosition(void) const
+      { 
+         return (this->p_unused); 
+      }
+
+      //---------------------------------------------------------------
+
+      void CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)
+      {
+         StdSize position = data_begin;        
+         while (position != data_end)
+         {
+            this->nbrequest++;
+            position = SuperClass::getNextDataPosition(position); // manager id           
+            position = SuperClass::getNextDataPosition(position); // method id           
+            SuperClass::updateBufferData(position);
+            long int nbarg = SuperClass::getInt(position);
+            position = SuperClass::getNextDataPosition(position);
+            for (long int i = 0; i < nbarg; i++)
+               position = SuperClass::getNextDataPosition(position);
+               
+            if (position > data_end)
+              ERROR("CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)",
+                     << "[ position courante" << position
+                     << ", fin de traitement" << data_end << " ] "
+                     << "Impossible de mettre Ã  jour la liste des requÃªtes !");
+         }
+      }
+
+      ///------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/circular_buffer.hpp
===================================================================
--- /XIOS/trunk/src/circular_buffer.hpp	(revision 306)
+++ /XIOS/trunk/src/circular_buffer.hpp	(revision 306)
@@ -0,0 +1,72 @@
+#ifndef __XMLIO_CCircularBuffer__
+#define __XMLIO_CCircularBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "linear_buffer.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CCircularBuffer
+         : public CBuffer
+      {
+
+            /// DÃ©finition de type ///
+            typedef CBuffer SuperClass;
+
+         public :
+
+            /// Construteurs ///
+            explicit CCircularBuffer(StdSize size = BUFFER_SERVER_SIZE);
+            CCircularBuffer(const CCircularBuffer & cbuffer);
+            CCircularBuffer(const CCircularBuffer * const cbuffer);
+
+            /// Mutateurs ///
+            virtual void clear(void);
+
+            char * prepareNextData(StdSize data_size);
+            StdSize prepareNextDataPosition(StdSize data_size);
+
+            void appendRequest(const CLinearBuffer & brequest);
+
+            void updateNbRequests(StdSize data_begin, StdSize data_end);
+
+            /// Test ///
+            bool hasRequest(void) const ;
+            bool isAvailable(StdSize data_size) const;
+
+            /// Accesseurs ///
+            CLinearBuffer getNextRequest(void);
+            StdSize getNumberOfRequest(void) const;
+
+            StdSize getReadPosition(void) const;
+            StdSize getWritePosition(void) const;
+            StdSize getUnusedPosition(void) const;
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename);
+            virtual void printToTextStream (StdOStream & ostr);
+
+            /// Destructeur ///
+            virtual ~CCircularBuffer(void);
+
+         private :
+
+            /// Mutateurs privÃ©s ///
+            void movePWrite(StdSize data_size);
+            void movePRead(StdSize data_size);
+
+            /// Accesseurs privÃ©s ///
+            StdSize getNextRequestSize(void) const;
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            StdSize p_write, p_read, p_unused, nbrequest;
+
+      }; // class CCircularBuffer
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CCircularBuffer__
Index: /XIOS/trunk/src/client.cpp
===================================================================
--- /XIOS/trunk/src/client.cpp	(revision 306)
+++ /XIOS/trunk/src/client.cpp	(revision 306)
@@ -0,0 +1,133 @@
+#include "client.hpp"
+
+#include "linear_buffer_impl.hpp"
+
+namespace xmlioserver {
+namespace comm {
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   
+   CClient::CClient(MPI_Comm comm_client_server)
+      : bpair(comm_client_server)
+   { 
+      this->initialize();
+   }  
+        
+   CClient::~CClient(void)
+   { 
+      //this->finalize();
+   } 
+   
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CClient> CClient::Client;
+
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CClient> CClient::CreateClient(MPI_Comm comm_client_server)
+   {
+      if (CClient::Client.get() == NULL)
+         CClient::Client = boost::shared_ptr<CClient>(new CClient(comm_client_server));
+      return (CClient::GetClient());
+   }
+
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CClient> CClient::GetClient(void)
+   {
+      return (CClient::Client);
+   }
+
+   ///--------------------------------------------------------------
+   
+   const CBufferPair & CClient::getBufferPair(void) const 
+   {
+      return (this->bpair);
+   }   
+   
+   //---------------------------------------------------------------
+
+   void CClient::initialize(void)
+   {
+      this->bpair.prepareRequest(0, 0, CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG);
+      // Pas d'argument Ã  ajouter.
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CClient::finalize(void)
+   {
+      this->bpair.prepareRequest(0, 1, CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG);
+      // Pas d'argument Ã  ajouter.
+      this->bpair.sendCurrentBuffer();
+      comm::CMPIManager::Barrier(CMPIManager::GetCommClientServer());
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CClient::setContext(const StdString & idContext)
+   {
+      this->bpair.prepareRequest(1, 0, &idContext,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG);
+      this->bpair.getCurrentBuffer().appendString(idContext);
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CClient::updateCalendar(long int timestep)
+   {
+       this->bpair.prepareRequest(1, 1, &timestep,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG);
+      this->bpair.getCurrentBuffer().appendInt(timestep);
+   }
+
+   //---------------------------------------------------------------
+
+   void CClient::setTimestep(const date::CDuration & duration)
+   {
+      StdString durationstr = duration.toString();
+      this->bpair.prepareRequest(1, 2, &durationstr,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG,
+                                       CLinearBuffer::NULL_ARG);
+      this->bpair.getCurrentBuffer().appendString(durationstr);
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CClient::sendData
+      (const StdString & fieldId, const StdString & fileId, const ARRAY(float, 1) dataArray)
+   {
+      this->bpair.prepareRequest(2, 0, &fieldId, &fileId, &dataArray,
+                                       CLinearBuffer::NULL_ARG);
+      this->bpair.getCurrentBuffer().appendString(fieldId);
+      this->bpair.getCurrentBuffer().appendString(fileId);
+      this->bpair.getCurrentBuffer().appendFloatArray(dataArray);
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CClient::sendData
+      (const StdString & fieldId, const StdString & fileId, const ARRAY(double, 1) dataArray)
+   {
+      this->bpair.prepareRequest(2, 1, &fieldId, &fileId, &dataArray,
+                                       CLinearBuffer::NULL_ARG);
+      this->bpair.getCurrentBuffer().appendString(fieldId);
+      this->bpair.getCurrentBuffer().appendString(fileId);
+      this->bpair.getCurrentBuffer().appendDoubleArray(dataArray);
+   }
+
+   ///--------------------------------------------------------------
+
+} // namespace comm
+} // namespace xmlioserver
Index: /XIOS/trunk/src/client.hpp
===================================================================
--- /XIOS/trunk/src/client.hpp	(revision 306)
+++ /XIOS/trunk/src/client.hpp	(revision 306)
@@ -0,0 +1,64 @@
+#ifndef __XMLIO_Client__
+#define __XMLIO_Client__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "mpi_manager.hpp"
+#include "buffer_pair.hpp"
+#include "array.hpp"
+#include "duration.hpp"
+
+namespace xmlioserver {
+namespace comm {
+
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   
+   class CClient
+   {
+      public :
+
+         static boost::shared_ptr<CClient> CreateClient(MPI_Comm comm_client_server);
+         static boost::shared_ptr<CClient> GetClient(void);
+                
+         /// Destructeur ///
+         ~CClient(void);  
+         
+      public : 
+      
+         /// Accesseur ///
+         const CBufferPair & getBufferPair(void) const;
+              
+         /// Appels distants///   
+         void initialize(void); // manager 0, method 0
+         void finalize(void);   // manager 0, method 1
+         
+      public : 
+       
+         void setContext(const StdString & idContext);      // manager 1, method 0
+         void updateCalendar(long int timestep);            // manager 1, method 1
+         void setTimestep(const date::CDuration & duration);// manager 1, method 2
+         
+         void sendData(const StdString & fieldId,
+                       const StdString & fileId,
+                       const ARRAY(float, 1)  dataArray); // manager 2, method 0
+         
+         void sendData(const StdString & fieldId,
+                       const StdString & fileId,
+                       const ARRAY(double, 1) dataArray); // manager 2, method 1
+         
+      private :
+
+         /// Constructeurs ///
+         CClient(MPI_Comm comm_client_server);
+      
+         /// PropriÃ©tÃ© privÃ©e ///
+         CBufferPair bpair;
+
+         static boost::shared_ptr<CClient> Client;
+      
+   }; // class CClient   
+   
+} // namespace comm
+} // namespace xmlioserver
+
+#endif //__XMLIO_Client__
Index: /XIOS/trunk/src/client_ym.cpp
===================================================================
--- /XIOS/trunk/src/client_ym.cpp	(revision 306)
+++ /XIOS/trunk/src/client_ym.cpp	(revision 306)
@@ -0,0 +1,252 @@
+#include "xmlioserver_spl.hpp"
+#include "cxios.hpp"
+#include "client_ym.hpp"
+#include <boost/functional/hash.hpp>
+#include "type.hpp"
+#include "buffer.hpp"
+#include "context.hpp"
+#include "context_client.hpp"
+#include "tree_manager.hpp"
+#include "oasis_cinterface.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{                      
+  namespace ym
+  {
+
+    MPI_Comm CClient::intraComm ;
+    MPI_Comm CClient::interComm ;
+    int CClient::serverLeader ;
+    bool CClient::is_MPI_Initialized ;
+    
+    
+    void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)
+    {
+      int initialized ;
+      MPI_Initialized(&initialized) ;
+      if (initialized) is_MPI_Initialized=true ;
+      else is_MPI_Initialized=false ;
+      
+// don't use OASIS
+      if (!CXios::usingOasis)
+      {
+// localComm doesn't given
+        if (localComm == MPI_COMM_NULL)
+        {
+          if (!is_MPI_Initialized) 
+          {
+            int argc=0;
+            char** argv=NULL;
+            MPI_Init(&argc,&argv) ;
+          }
+          boost::hash<string> hashString ;    
+    
+          unsigned long hashClient=hashString(codeId) ;
+          unsigned long hashServer=hashString(CXios::xiosCodeId) ;
+          unsigned long* hashAll ;
+          int rank ;
+          int size ;
+          int myColor ;
+          int i,c ;
+          MPI_Comm newComm ;
+      
+          MPI_Comm_size(CXios::globalComm,&size) ;
+          MPI_Comm_rank(CXios::globalComm,&rank);
+          hashAll=new unsigned long[size] ;
+     
+          MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ;
+
+          map<unsigned long, int> colors ;
+          map<unsigned long, int> leaders ;
+      
+          for(i=0,c=0;i<size;i++)
+          {
+            if (colors.find(hashAll[i])==colors.end())
+            {
+              colors[hashAll[i]] =c ;
+              leaders[hashAll[i]]=i ;
+              c++ ;
+            }
+          }
+     
+          myColor=colors[hashClient] ;
+      
+          MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
+
+          if (CXios::usingServer)
+          {     
+            int clientLeader=leaders[hashClient] ;
+            serverLeader=leaders[hashServer] ;
+            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
+          }
+          else
+          {
+            MPI_Comm_dup(intraComm,&interComm) ;
+          }
+          delete [] hashAll ;
+        }
+        // localComm argument is given
+        else 
+        {
+          if (CXios::usingServer)
+          {          
+            //ERROR("void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)", << " giving a local communictor is not compatible with using server mode") ;
+          }
+          else
+          {
+            MPI_Comm_dup(localComm,&intraComm) ;
+            MPI_Comm_dup(intraComm,&interComm) ;
+          }
+        }
+      }
+      // using OASIS
+      else
+      {
+        // localComm doesn't given
+        if (localComm == MPI_COMM_NULL)
+        {
+          if (!is_MPI_Initialized) oasis_init(codeId) ;
+          oasis_get_localcomm(intraComm) ;
+        }
+        else MPI_Comm_dup(localComm,&intraComm) ;
+  
+        if (CXios::usingServer) 
+        {
+          MPI_Status status ;
+          int 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) ;
+          MPI_Bcast(&serverLeader,1,MPI_INT,0,intraComm) ;
+           
+        }
+        else MPI_Comm_dup(intraComm,&interComm) ;
+      }
+          
+      MPI_Comm_dup(intraComm,&returnComm) ;
+    }
+    
+    
+    
+    
+/*    
+    void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)
+    {
+      boost::hash<string> hashString ;    
+    
+      unsigned long hashClient=hashString(codeId) ;
+      unsigned long hashServer=hashString(CXios::xiosCodeId) ;
+      unsigned long* hashAll ;
+      int rank ;
+      int size ;
+      int myColor ;
+      int i,c ;
+      MPI_Comm newComm ;
+      
+      MPI_Comm_size(CXios::globalComm,&size) ;
+      MPI_Comm_rank(CXios::globalComm,&rank);
+      hashAll=new unsigned long[size] ;
+     
+      MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ;
+
+      map<unsigned long, int> colors ;
+      map<unsigned long, int> leaders ;
+      
+      for(i=0,c=0;i<size;i++)
+      {
+        if (colors.find(hashAll[i])==colors.end())
+        {
+          colors[hashAll[i]] =c ;
+          leaders[hashAll[i]]=i ;
+          c++ ;
+        }
+        
+      }
+     
+      myColor=colors[hashClient] ;
+      
+      MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
+
+      if (!CXios::isServer)
+      {     
+        int clientLeader=leaders[hashClient] ;
+        serverLeader=leaders[hashServer] ;
+        MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
+      }
+      else
+      {
+        MPI_Comm_dup(intraComm,&interComm) ;
+      }
+
+      delete [] hashAll ;
+    }
+  */
+    
+    void CClient::registerContext(const string& id,MPI_Comm contextComm)
+    {
+      CObjectFactory::SetCurrentContextId(id);
+      shared_ptr<CContext> context=tree::CTreeManager::CreateContext(id) ;
+        
+      if (!CXios::isServer)
+      {
+        int size,rank,globalRank ;
+        size_t message_size ;
+        int leaderRank ;
+        MPI_Comm contextInterComm ;
+      
+        MPI_Comm_size(contextComm,&size) ;
+        MPI_Comm_rank(contextComm,&rank) ;
+        MPI_Comm_rank(CXios::globalComm,&globalRank) ;
+        if (rank!=0) globalRank=0 ;
+      
+    
+        CMessage msg ;
+        msg<<id<<size<<globalRank ;
+
+        int messageSize=msg.size() ;
+        void * buff = new char[messageSize] ;
+        CBufferOut buffer(buff,messageSize) ;
+        buffer<<msg ;
+      
+        MPI_Send(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) ;
+        MPI_Barrier(inter) ;
+
+        context->initClient(contextComm,contextInterComm) ;
+      }
+      else
+      {
+        MPI_Comm contextInterComm ;
+        MPI_Comm_dup(contextComm,&contextInterComm) ;
+        context->initClient(contextComm,contextInterComm) ;
+        context->initServer(contextComm,contextInterComm) ;
+      }
+    }
+    
+    void CClient::finalize(void)
+    {
+      int rank ;
+      int msg=0 ;
+      MPI_Comm_rank(intraComm,&rank) ;  
+      if (rank==0) 
+      {
+        MPI_Send(&msg,1,MPI_INT,0,0,interComm) ;
+      }
+      
+      if (!is_MPI_Initialized)
+      {
+        if (CXios::usingOasis) oasis_finalize();
+        else MPI_Finalize() ;
+      }
+      info(20) << "Client side context is finalized"<<endl ;
+    }
+  }
+}
Index: /XIOS/trunk/src/client_ym.hpp
===================================================================
--- /XIOS/trunk/src/client_ym.hpp	(revision 306)
+++ /XIOS/trunk/src/client_ym.hpp	(revision 306)
@@ -0,0 +1,27 @@
+#ifndef __CLIENT_YM__HPP__
+#define __CLIENT_YM__HPP__
+
+#include "xmlioserver_spl.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{                      
+  namespace ym
+  {
+    class CClient
+    {
+       public:
+       
+       static void initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm) ;
+       static void finalize(void) ;
+       static void registerContext(const string& id,MPI_Comm contextComm) ;
+
+       static MPI_Comm intraComm ;
+       static MPI_Comm interComm ;
+       static int serverLeader;
+       static bool is_MPI_Initialized ;
+    } ;
+  }
+}
+
+#endif
Index: /XIOS/trunk/src/config/axis_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/axis_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/axis_attribute.conf	(revision 306)
@@ -0,0 +1,10 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, standard_name)
+DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, unit)
+
+DECLARE_ATTRIBUTE(int,       size)
+DECLARE_ATTRIBUTE(ARRAY(double, 1), zvalue)
+
+
Index: /XIOS/trunk/src/config/calendar_type.conf
===================================================================
--- /XIOS/trunk/src/config/calendar_type.conf	(revision 306)
+++ /XIOS/trunk/src/config/calendar_type.conf	(revision 306)
@@ -0,0 +1,21 @@
+#ifdef __XMLIO_CAllLeapCalendar__
+   DECLARE_CALENDAR(AllLeap  , AllLeap)
+#endif //__XMLIO_CAllLeapCalendar__
+
+#ifdef __XMLIO_CD360Calendar__
+   DECLARE_CALENDAR(D360  , D360)
+#endif //__XMLIO_CD360Calendar__
+
+#ifdef __XMLIO_CGregorianCalendar__
+   DECLARE_CALENDAR(Gregorian  , Gregorian)
+#endif //__XMLIO_CGregorianCalendar__
+
+#ifdef __XMLIO_CJulianCalendar__
+   DECLARE_CALENDAR(Julian  , Julian)
+#endif //__XMLIO_CJulianCalendar__
+
+#ifdef __XMLIO_CNoLeapCalendar__
+   DECLARE_CALENDAR(NoLeap  , NoLeap)
+#endif //__XMLIO_CNoLeapCalendar__
+
+#undef DECLARE_CALENDAR
Index: /XIOS/trunk/src/config/context_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/context_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/context_attribute.conf	(revision 306)
@@ -0,0 +1,5 @@
+DECLARE_ATTRIBUTE(StdString, calendar_type)
+DECLARE_ATTRIBUTE(StdString, start_date)
+DECLARE_ATTRIBUTE(StdString, timestep)
+DECLARE_ATTRIBUTE(StdString, output_dir)
+
Index: /XIOS/trunk/src/config/domain_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/domain_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/domain_attribute.conf	(revision 306)
@@ -0,0 +1,55 @@
+/* GLOBAL */
+DECLARE_ATTRIBUTE(StdString       , name)
+DECLARE_ATTRIBUTE(StdString       , standard_name)
+DECLARE_ATTRIBUTE(StdString       , long_name)
+
+/* SpÃ©cifique */
+DECLARE_ATTRIBUTE(StdString       , domain_group_ref)
+
+/* GLOBAL */
+DECLARE_ATTRIBUTE(int             , ni_glo)
+DECLARE_ATTRIBUTE(int             , nj_glo)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(int             , ibegin)
+DECLARE_ATTRIBUTE(int             , iend)
+DECLARE_ATTRIBUTE(int             , ni)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(int             , jbegin)
+DECLARE_ATTRIBUTE(int             , jend)
+DECLARE_ATTRIBUTE(int             , nj)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(ARRAY(bool, 2)  , mask)
+
+/* GLOBAL */
+DECLARE_ATTRIBUTE(int             , data_dim)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(int             , data_ni)
+DECLARE_ATTRIBUTE(int             , data_nj)
+DECLARE_ATTRIBUTE(int             , data_ibegin)
+DECLARE_ATTRIBUTE(int             , data_jbegin)
+
+/* GLOBAL */
+DECLARE_ATTRIBUTE(int             , zoom_ni)
+DECLARE_ATTRIBUTE(int             , zoom_nj)
+DECLARE_ATTRIBUTE(int             , zoom_ibegin)
+DECLARE_ATTRIBUTE(int             , zoom_jbegin)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(int             , zoom_ni_loc)
+DECLARE_ATTRIBUTE(int             , zoom_nj_loc)
+DECLARE_ATTRIBUTE(int             , zoom_ibegin_loc)
+DECLARE_ATTRIBUTE(int             , zoom_jbegin_loc)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(int             , data_n_index)
+DECLARE_ATTRIBUTE(ARRAY(int, 1)   , data_i_index)
+DECLARE_ATTRIBUTE(ARRAY(int, 1)   , data_j_index)
+
+/* LOCAL */
+DECLARE_ATTRIBUTE(ARRAY(double, 1), lonvalue)
+DECLARE_ATTRIBUTE(ARRAY(double, 1), latvalue)
+
Index: /XIOS/trunk/src/config/field_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/field_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/field_attribute.conf	(revision 306)
@@ -0,0 +1,21 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, standard_name)
+DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, unit)
+DECLARE_ATTRIBUTE(StdString, operation)
+
+DECLARE_ATTRIBUTE(StdString, freq_op)
+DECLARE_ATTRIBUTE(StdString, freq_offset)
+DECLARE_ATTRIBUTE(int,       level)
+DECLARE_ATTRIBUTE(int,       prec)
+
+DECLARE_ATTRIBUTE(bool,      enabled)
+
+DECLARE_ATTRIBUTE(StdString, domain_ref)
+DECLARE_ATTRIBUTE(StdString, axis_ref)
+DECLARE_ATTRIBUTE(StdString, grid_ref)
+//DECLARE_ATTRIBUTE(StdString, zoom_ref)
+DECLARE_ATTRIBUTE(StdString, field_ref)
+
+DECLARE_ATTRIBUTE(double,    default_value)
Index: /XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/file_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/file_attribute.conf	(revision 306)
@@ -0,0 +1,12 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, description)
+
+DECLARE_ATTRIBUTE(StdString, name_suffix)
+
+DECLARE_ATTRIBUTE(StdString, output_freq)
+DECLARE_ATTRIBUTE(int,       output_level)
+
+DECLARE_ATTRIBUTE(bool,      enabled)
+DECLARE_ATTRIBUTE(StdString,      type)
+
+// DECLARE_ATTRIBUTE_DEF(bool, enabled, true)
Index: /XIOS/trunk/src/config/functor_type.conf
===================================================================
--- /XIOS/trunk/src/config/functor_type.conf	(revision 306)
+++ /XIOS/trunk/src/config/functor_type.conf	(revision 306)
@@ -0,0 +1,22 @@
+#ifdef __XMLIO_CAverage__
+   DECLARE_FUNCTOR(Average  , average)
+#endif //__XMLIO_CAverage__
+
+#ifdef __XMLIO_CInstant__
+   DECLARE_FUNCTOR(Instant, instant)
+#endif //__XMLIO_CInstant__
+
+#ifdef __XMLIO_COnce__
+   DECLARE_FUNCTOR(Once, once)
+#endif //__XMLIO_COnce__
+
+#ifdef __XMLIO_CMaximum__
+   DECLARE_FUNCTOR(Maximum , maximum)
+#endif //__XMLIO_CMaximum__
+
+#ifdef __XMLIO_CMinimum__
+   DECLARE_FUNCTOR(Minimum , minimum)
+#endif //__XMLIO_CMinimum__
+
+
+#undef DECLARE_FUNCTOR
Index: /XIOS/trunk/src/config/grid_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/grid_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/grid_attribute.conf	(revision 306)
@@ -0,0 +1,5 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, description)
+DECLARE_ATTRIBUTE(StdString, domain_ref)
+DECLARE_ATTRIBUTE(StdString, axis_ref)
+
Index: /XIOS/trunk/src/config/node_type.conf
===================================================================
--- /XIOS/trunk/src/config/node_type.conf	(revision 306)
+++ /XIOS/trunk/src/config/node_type.conf	(revision 306)
@@ -0,0 +1,34 @@
+#ifdef __XMLIO_CAxis__
+   DECLARE_NODE(Axis  , axis  )
+#endif //__XMLIO_CAxis__
+
+#ifdef __XMLIO_CDomain__
+   DECLARE_NODE(Domain, domain)
+#endif //__XMLIO_CDomain__
+
+#ifdef __XMLIO_CField__
+   DECLARE_NODE(Field , field )
+#endif //__XMLIO_CField__
+
+#ifdef __XMLIO_CFile__
+   DECLARE_NODE(File  , file  )
+#endif //__XMLIO_CFile__
+
+#ifdef __XMLIO_CGrid__
+   DECLARE_NODE(Grid  , grid  )
+#endif //__XMLIO_CGrid__
+
+//#ifdef __XMLIO_CMethod__
+//   DECLARE_NODE(Method, method)
+//#endif //__XMLIO_CMethod__
+
+#ifdef __XMLIO_CVariable__
+   DECLARE_NODE(Variable, variable)
+#endif //__XMLIO_CVariable__
+
+#ifdef __XMLIO_CContext__
+   DECLARE_NODE_PAR(Context, context)
+#endif //__XMLIO_CContext__
+
+#undef DECLARE_NODE
+#undef DECLARE_NODE_PAR
Index: /XIOS/trunk/src/config/properties.conf
===================================================================
--- /XIOS/trunk/src/config/properties.conf	(revision 306)
+++ /XIOS/trunk/src/config/properties.conf	(revision 306)
@@ -0,0 +1,24 @@
+/// Author ///
+DECLARE_PROPERTY  (StdString, AUTHOR, "OZDOBA HervÃ©, MEURDESOIF Yann")
+
+/// Version number ///
+DECLARE_PROPERTY  (StdString, VERSION, "0.1")
+
+/// Time name ///
+DECLARE_PROPERTY  (StdString, TIME_NAME, "time")
+
+/// Output config ///
+//DECLARE_PROPERTY  (StdString, NETCDF_OUTPUT,  "MULTI_FILE") // (ONE_FILE, TWO_FILE, MULTI_FILE)
+DECLARE_PROPERTY  (StdString, NETCDF_OUTPUT,  "ONE_FILE") // (ONE_FILE, TWO_FILE, MULTI_FILE)
+DECLARE_PROPERTY  (StdString, FILE_SUFFIX,    "_node"   )
+DECLARE_PROPERTY  (StdString, FILE_EXTENSION, ".nc"     )
+DECLARE_PROPERTY  (StdString, OUTPUT_PATH,    "./data/" )
+
+/// Default Value ///
+DECLARE_PROPERTY (double, FIELD_DEFAULT_VALUE,  1E-10)
+
+/// Buffer Size ///
+DECLARE_PROPERTY (StdSize, BUFFER_CLIENT_SIZE,  100E6) // 100 Mo
+DECLARE_PROPERTY (StdSize, BUFFER_SERVER_SIZE, 1000E6) // 1000 Mo
+
+
Index: /XIOS/trunk/src/config/var_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/var_attribute.conf	(revision 306)
+++ /XIOS/trunk/src/config/var_attribute.conf	(revision 306)
@@ -0,0 +1,1 @@
+DECLARE_ATTRIBUTE(StdString, type)
Index: /XIOS/trunk/src/configure.cpp
===================================================================
--- /XIOS/trunk/src/configure.cpp	(revision 306)
+++ /XIOS/trunk/src/configure.cpp	(revision 306)
@@ -0,0 +1,14 @@
+#define __XMLIO_Configure__ // < Ne pas supprimer
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+/// /////////// Macros /////////// ///
+#undef  DECLARE_PROPERTY
+#define DECLARE_PROPERTY(type, name, value) \
+   type name = value;
+
+namespace xmlioserver
+{
+#include "properties.conf"
+} // namespace xmlioserver
Index: /XIOS/trunk/src/configure.hpp
===================================================================
--- /XIOS/trunk/src/configure.hpp	(revision 306)
+++ /XIOS/trunk/src/configure.hpp	(revision 306)
@@ -0,0 +1,14 @@
+#ifndef __XMLIO_Configure__
+#define __XMLIO_Configure__
+
+
+/// /////////// Macros /////////// ///
+#define DECLARE_PROPERTY(type, name, value) \
+   extern type name; // = value
+
+namespace xmlioserver
+{
+#include "properties.conf"
+} // namespace xmlioserver
+
+#endif // __XMLIO_Configure__
Index: /XIOS/trunk/src/context_client.cpp
===================================================================
--- /XIOS/trunk/src/context_client.cpp	(revision 306)
+++ /XIOS/trunk/src/context_client.cpp	(revision 306)
@@ -0,0 +1,198 @@
+#include "xmlioserver_spl.hpp"
+#include "context_client.hpp"
+#include "context_server.hpp"
+#include "event_client.hpp"
+#include "buffer_out.hpp"
+#include "buffer_client.hpp"
+#include "type.hpp"
+#include "message.hpp"
+#include "event_client.hpp"
+#include "transfert_parameters.hpp"
+#include "context.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+
+
+    CContextClient::CContextClient(tree::CContext* parent,MPI_Comm intraComm_, MPI_Comm interComm_)
+    {
+      context=parent ;
+      intraComm=intraComm_ ;
+      interComm=interComm_ ;
+      MPI_Comm_rank(intraComm,&clientRank) ;
+      MPI_Comm_size(intraComm,&clientSize) ;
+      
+      int flag ;
+      MPI_Comm_test_inter(interComm,&flag) ;
+      if (flag) MPI_Comm_remote_size(interComm,&serverSize);
+      else  MPI_Comm_size(interComm,&serverSize) ;
+     
+      timeLine=0 ;
+
+    }
+
+
+    void CContextClient::sendEvent(CEventClient& event)
+    {
+      list<int>::iterator itServer ;
+      list<int> ranks ;
+      list<int> sizes ;  
+      list<int>::iterator itSize ;
+      
+      ranks=event.getRanks() ;
+      if (! event.isEmpty())
+      {
+        sizes=event.getSizes() ;
+        CMessage msg ;
+
+        msg<<*(sizes.begin())<<timeLine ;
+        for(list<int>::iterator it=sizes.begin();it!=sizes.end();it++) *it+=msg.size() ;
+        list<CBufferOut*> buffList=getBuffers(ranks,sizes) ;
+      
+        list<CBufferOut*>::iterator it ;      
+        for(it=buffList.begin(),itSize=sizes.begin();it!=buffList.end();++it,++itSize)
+        {
+          **it<<*itSize<<timeLine ;
+        }
+        event.send(buffList) ;
+        checkBuffers(ranks) ;
+      }
+
+      if (context->hasServer) waitEvent(ranks) ;
+      timeLine++ ;
+    }
+      
+    void CContextClient::waitEvent(list<int>& ranks)
+    {
+      context->server->setPendingEvent() ;
+      while(checkBuffers(ranks) || context->server->hasPendingEvent())
+      {
+        context->server->eventLoop() ;
+      }
+    }
+
+    list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList)
+    {
+      list<int>::iterator itServer,itSize ;
+      list<CClientBuffer*> bufferList ; 
+      map<int,CClientBuffer*>::iterator it ; 
+      list<CClientBuffer*>::iterator itBuffer ; 
+      list<CBufferOut*>  retBuffer ;
+      bool free ;
+
+      for(itServer=serverList.begin();itServer!=serverList.end();itServer++) 
+      {
+        it=buffers.find(*itServer) ;
+        if (it==buffers.end()) 
+        {
+          newBuffer(*itServer) ;
+          it=buffers.find(*itServer) ;
+        }         
+        bufferList.push_back(it->second) ;
+      }
+      free=false ;
+      while(!free)
+      {
+        free=true ;
+        for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
+        {
+          (*itBuffer)->checkBuffer() ;
+         free&=(*itBuffer)->isBufferFree(*itSize) ;
+        }
+      }
+      for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
+      {
+        retBuffer.push_back((*itBuffer)->getBuffer(*itSize)) ;
+      }
+      return retBuffer ;             
+   
+   }
+     
+   void CContextClient::newBuffer(int rank)
+   {
+      buffers[rank]=new CClientBuffer(interComm,rank) ;
+   } 
+
+   bool CContextClient::checkBuffers(void)
+   {
+      map<int,CClientBuffer*>::iterator itBuff ;
+      bool pending=false ;
+      for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) pending|=itBuff->second->checkBuffer() ;
+      return pending ;
+   } 
+
+   void CContextClient::releaseBuffers(void)
+   {
+      map<int,CClientBuffer*>::iterator itBuff ;
+      for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) delete itBuff->second ;
+   } 
+
+   bool CContextClient::checkBuffers(list<int>& ranks)
+   {
+      list<int>::iterator it ;
+      bool pending=false ;
+      for(it=ranks.begin();it!=ranks.end();it++) pending|=buffers[*it]->checkBuffer() ;
+      return pending ;
+   } 
+
+   int CContextClient::getServerLeader(void)
+   {
+     int clientByServer=clientSize/serverSize ;
+     int remain=clientSize%serverSize ;
+     
+     if (clientRank<(clientByServer+1)*remain)
+     {
+       return clientRank/(clientByServer+1) ;
+     }
+     else
+     {
+       int rank=clientRank-(clientByServer+1)*remain ;
+       int nbServer=serverSize-remain ;
+       return remain+rank/clientByServer ;
+     }
+   }      
+
+   bool CContextClient::isServerLeader(void)
+   {
+     int clientByServer=clientSize/serverSize ;
+     int remain=clientSize%serverSize ;
+     
+     if (clientRank<(clientByServer+1)*remain)
+     {
+       if (clientRank%(clientByServer+1)==0) return true ;
+       else return false ;
+     }
+     else
+     {
+       int rank=clientRank-(clientByServer+1)*remain ;
+       int nbServer=serverSize-remain ;
+       if  (rank%clientByServer==0) return true ;
+       else return false ;
+     } 
+   }
+     
+   void CContextClient::finalize(void)
+   {
+      
+     map<int,CClientBuffer*>::iterator itBuff ;
+     bool stop=true ;
+
+     CEventClient event(CContext::GetType(),CContext::EVENT_ID_CONTEXT_FINALIZE) ;   
+     if (isServerLeader())
+     {
+       CMessage msg ;
+       event.push(getServerLeader(),1,msg) ;
+     }
+     sendEvent(event) ;
+       
+     while(stop)
+     {
+       checkBuffers() ;
+       stop=false ;
+       for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) stop|=itBuff->second->hasPendingRequest() ;
+     }
+         
+     releaseBuffers() ;
+   }
+}      
Index: /XIOS/trunk/src/context_client.cpp.old
===================================================================
--- /XIOS/trunk/src/context_client.cpp.old	(revision 306)
+++ /XIOS/trunk/src/context_client.cpp.old	(revision 306)
@@ -0,0 +1,149 @@
+#include "xmlioserver_spl.hpp"
+#include "context_client.hpp"
+#include "event_client.hpp"
+#include "buffer_out.hpp"
+#include "buffer_client.hpp"
+#include "type.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+
+
+    CContextClient::CContextClient(MPI_Comm intraComm_, MPI_Comm interComm_)
+    {
+      intraComm=intraComm_ ;
+      interComm=interComm_ ;
+      MPI_Comm_rank(intraComm,&clientRank) ;
+      MPI_Comm_size(intraComm,&clientSize) ;
+      MPI_Comm_remote_size(interComm,&serverSize) ;
+      
+      timeLine=0 ;
+      locked=false; 
+    }
+
+
+
+    void CContextClient::registerEvent(CEventClient& event)
+    {
+      list<int>::iterator it;
+      map<int,CClientBuffer*> clientBuffer ;
+      
+      for(it=event.serverList.begin();it!=event.serverList.end();it++)
+      {
+        
+        if (connectedServer.find(*it)==connectedServer.end())
+        {
+          connectedServer.insert(*it) ;
+          buffers[*it]=new CClientBuffer(interComm,*it) ;
+        }
+      }
+    }
+
+
+
+    list<CBufferOut*> CContextClient::newEvent(CEventClient& event,list<int>& sizes)
+    {
+      
+      if (locked==true) ERROR("list<CBufferOut*> CContextClient::newEvent(CEventClient& event,list<int>& sizes)",
+                              "event is locked. Please send last event before requesting a new event") ; 
+      
+      list<CBufferOut*> buffers ; 
+      list<CBufferOut*>::iterator itBuff ; 
+      list<int>::iterator it ;
+      
+//      CType<size_t> ttimeLine(timeLine) ;
+//      int size ;
+//      CType<int> tsize(size) ;
+//      int offset=tsize.size()+ttimeLine.size() ;
+
+      int size ;
+      timeLine++ ;
+      CMessage msg ;
+      msg<<size<<timeLine ;
+            
+      for(it=sizes.begin();it!=sizes.end();it++) *it+=msg.size() ;
+      buffers=getBuffers(event.serverList,sizes) ;
+      
+      it=sizes.begin() ;
+      for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++)
+      {
+        size=*it ;
+        *(*itBuff)<<msg ;
+        it++ ;
+      }      
+    
+      locked=true ;
+      return buffers ;
+    
+    }
+    
+
+
+    void CContextClient::sendEvent(CEventClient& event)
+    {
+      list<int>::iterator itServer ;
+      list<int>::ranks ;
+      list<int>::sizes ;  
+      list<int>::iterator itSize ;
+      
+//      if (locked==false) ERROR("void CContextClient::sendEvent(CEventClient& event)",
+//                              "event is not locked. Please request a new event before sending it") ;
+      ranks=event.getRanks() ;
+      sizes=event.getSizes() ;
+      
+      list<CMessage> msg<<sizes.begin()<<timeLine ;
+      
+      for(list<int>::iterator it=sizes.begin();it!=sizes.end();it++) *it+=msg.size() ;
+      list<CBufferOut*> buffList=getBuffers(ranks,sizes) ;
+      
+      
+      
+      for(list<CBufferOut*>::iterator it=buffList.begin(),itSize=sizes.begin() ;;it!=buffList.end();it++)
+      {
+         **it<<
+        
+      
+      
+                               
+      for(itServer=event.serverList.begin();itServer!=event.serverList.end();itServer++) 
+      {
+        buffers[*itServer]->checkBuffer() ;
+      }
+    }
+    
+
+
+    list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList)
+    {
+      list<int>::iterator itServer,itSize ;
+      list<CClientBuffer*> bufferList ; 
+      list<CClientBuffer*>::iterator itBuffer ; 
+      list<CBufferOut*>  retBuffer ;
+      bool free ;
+      
+      for(itServer=serverList.begin();itServer!=serverList.end();itServer++) bufferList.push_back(buffers[*itServer]) ;
+
+      free=false ;
+      while(!free)
+      {
+        free=true ;
+        for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
+        {
+          (*itBuffer)->checkBuffer() ;
+          free&=(*itBuffer)->isBufferFree(*itSize) ;
+        }
+      }
+      
+      for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
+      {
+        retBuffer.push_back((*itBuffer)->getBuffer(*itSize)) ;
+      }
+      
+      return retBuffer ;             
+   
+   }
+     
+      
+
+}      
Index: /XIOS/trunk/src/context_client.hpp
===================================================================
--- /XIOS/trunk/src/context_client.hpp	(revision 306)
+++ /XIOS/trunk/src/context_client.hpp	(revision 306)
@@ -0,0 +1,58 @@
+#ifndef __CONTEXT_CLIENT_HPP__
+#define __CONTEXT_CLIENT_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "buffer_out.hpp"
+#include "buffer_client.hpp"
+#include "event_client.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  namespace tree
+  {
+    class CContext ;
+  }
+  
+  class CContextClient
+  {
+  
+    public:
+    CContextClient(tree::CContext* parent,MPI_Comm intraComm, MPI_Comm interComm) ;
+//    void registerEvent(CEventClient& event) ;
+
+//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ;  
+    void sendEvent(CEventClient& event) ;
+
+    list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList) ;
+    void newBuffer(int rank) ;
+    size_t timeLine ;
+    int clientRank ;
+    int clientSize ;
+    int serverSize ;
+//    set<int> connectedServer ;
+    MPI_Comm interComm ;
+    MPI_Comm intraComm ;
+    map<int,CClientBuffer*> buffers ;
+    bool checkBuffers(list<int>& ranks) ;
+    bool checkBuffers(void);
+    void releaseBuffers(void);
+    void closeContext(void) ;
+    bool isServerLeader(void) ;
+    int getServerLeader(void) ;
+    void finalize(void) ;
+    void waitEvent(list<int>& ranks) ;
+
+    tree::CContext* context ;
+//    bool locked ;
+    
+  } ;
+
+
+
+
+}
+
+
+
+#endif
Index: /XIOS/trunk/src/context_server.cpp
===================================================================
--- /XIOS/trunk/src/context_server.cpp	(revision 306)
+++ /XIOS/trunk/src/context_server.cpp	(revision 306)
@@ -0,0 +1,194 @@
+#include "context_server.hpp"
+#include "buffer_in.hpp"
+#include "type.hpp"
+#include "transfert_parameters.hpp"
+#include "context.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "tree_manager.hpp"
+#include "domain.hpp"
+
+#include <mpi.h>
+
+
+
+namespace xmlioserver
+{
+
+  CContextServer::CContextServer(tree::CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_)
+  {
+    context=parent ;
+    intraComm=intraComm_ ;
+    MPI_Comm_size(intraComm,&intraCommSize) ;
+    MPI_Comm_rank(intraComm,&intraCommRank) ;
+    interComm=interComm_ ;
+    int flag ;
+    MPI_Comm_test_inter(interComm,&flag) ;
+    if (flag) MPI_Comm_remote_size(interComm,&commSize);
+    else  MPI_Comm_size(interComm,&commSize) ;
+    currentTimeLine=0 ;
+    finished=false ;
+  }
+  void CContextServer::setPendingEvent(void)
+  {
+    pendingEvent=true ;
+  }
+  
+  bool CContextServer::hasPendingEvent(void)
+  {
+    return pendingEvent ;
+  }
+  
+  bool CContextServer::eventLoop(void)
+  {
+    listen() ;
+    checkPendingRequest() ;
+    processEvents() ;
+    return finished ;
+  }
+
+  void CContextServer::listen(void)
+  {
+    int rank;
+    int flag ;
+    int count ;
+    char * addr ;
+    MPI_Status status; 
+    map<int,CServerBuffer*>::iterator it;
+    
+    for(rank=0;rank<commSize;rank++)
+    {
+      if (pendingRequest.find(rank)==pendingRequest.end())
+      {
+        MPI_Iprobe(rank,20,interComm,&flag,&status);     
+        if (flag==true)
+        {
+          it=buffers.find(rank) ;
+          if (it==buffers.end()) 
+            it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer))).first ;
+          MPI_Get_count(&status,MPI_CHAR,&count) ;
+          if (it->second->isBufferFree(count))
+          {
+            addr=(char*)it->second->getBuffer(count) ;
+            MPI_Irecv(addr,count,MPI_CHAR,rank,20,interComm,&pendingRequest[rank]) ;
+            bufferRequest[rank]=addr ;
+          }
+        }
+      }
+    }
+  }
+  
+  void CContextServer::checkPendingRequest(void)
+  {
+    map<int,MPI_Request>::iterator it;
+    list<int> recvRequest ;
+    list<int>::iterator itRecv;
+    int rank ;
+    int flag ;
+    int count ;
+    MPI_Status status ;
+    
+    for(it=pendingRequest.begin();it!=pendingRequest.end();it++)
+    {
+      rank=it->first ;
+      MPI_Test(& it->second, &flag, &status) ;
+      if (flag==true)
+      {
+        recvRequest.push_back(rank) ;
+        MPI_Get_count(&status,MPI_CHAR,&count) ;
+        processRequest(rank,bufferRequest[rank],count) ;
+      }
+    }
+    
+    for(itRecv=recvRequest.begin();itRecv!=recvRequest.end();itRecv++) 
+    {
+      pendingRequest.erase(*itRecv) ;
+      bufferRequest.erase(*itRecv) ;
+    }
+  }
+  
+  void CContextServer::processRequest(int rank, char* buff,int count)
+  {
+    
+    CBufferIn buffer(buff,count) ;
+    char* startBuffer,endBuffer ;
+    int size, offset ;
+    size_t timeLine ;
+    map<size_t,CEventServer*>::iterator it ;
+       
+    while(count>0)
+    {
+      char* startBuffer=(char*)buffer.ptr() ;
+      CBufferIn newBuffer(startBuffer,buffer.remain()) ;
+      newBuffer>>size>>timeLine ;
+
+      it=events.find(timeLine) ;
+      if (it==events.end()) it=events.insert(pair<int,CEventServer*>(timeLine,new CEventServer)).first ;
+      it->second->push(rank,buffers[rank],startBuffer,size) ;
+
+      buffer.advance(size) ;
+      count=buffer.remain() ;           
+    } 
+  
+  }
+    
+  void CContextServer::processEvents(void)
+  {
+    map<size_t,CEventServer*>::iterator it ;
+    CEventServer* event ;
+    
+    it=events.find(currentTimeLine) ;
+    if (it!=events.end()) 
+    {
+      event=it->second ;
+      if (event->isFull())
+      {
+         dispatchEvent(*event) ;
+         pendingEvent=false ;
+         delete event ;
+         events.erase(it) ;
+         currentTimeLine++ ;
+       }
+     }
+   }
+       
+  CContextServer::~CContextServer()
+  {
+    map<int,CServerBuffer*>::iterator it ;
+    for(it=buffers.begin();it!=buffers.end();++it) delete it->second ; 
+  } 
+
+
+  void CContextServer::dispatchEvent(CEventServer& event)
+  {
+    string contextName ;
+    string buff ;
+    int MsgSize ;
+    int rank ;
+    list<CEventServer::SSubEvent>::iterator it ;
+    tree::CTreeManager::SetCurrentContextId(context->getId()) ;
+        
+    if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE)
+    {
+      info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl ;
+      context->finalize() ;
+      finished=true ;
+    }
+    else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event) ;
+    else if (event.classId==CContextGroup::GetType()) CContextGroup::dispatchEvent(event) ;
+    else if (event.classId==CDomain::GetType()) CDomain::dispatchEvent(event) ;
+    else if (event.classId==CDomainGroup::GetType()) CDomainGroup::dispatchEvent(event) ;
+    else if (event.classId==CAxis::GetType()) CAxis::dispatchEvent(event) ;
+    else if (event.classId==CAxisGroup::GetType()) CAxisGroup::dispatchEvent(event) ;
+    else if (event.classId==CGrid::GetType()) CGrid::dispatchEvent(event) ;
+    else if (event.classId==CGridGroup::GetType()) CGridGroup::dispatchEvent(event) ;
+    else if (event.classId==CField::GetType()) CField::dispatchEvent(event) ;
+    else if (event.classId==CFieldGroup::GetType()) CFieldGroup::dispatchEvent(event) ;
+    else if (event.classId==CFile::GetType()) CFile::dispatchEvent(event) ;
+    else if (event.classId==CFileGroup::GetType()) CFileGroup::dispatchEvent(event) ;
+    else
+    {
+      ERROR("void CContextServer::dispatchEvent(CEventServer& event)",<<" Bad event class Id"<<endl) ;
+    }
+  }
+}
Index: /XIOS/trunk/src/context_server.hpp
===================================================================
--- /XIOS/trunk/src/context_server.hpp	(revision 306)
+++ /XIOS/trunk/src/context_server.hpp	(revision 306)
@@ -0,0 +1,51 @@
+#ifndef __CONTEXT_SERVER_HPP__
+#define __CONTEXT_CLIENT_HPP__
+#include "xmlioserver_spl.hpp"
+#include "event_server.hpp"
+#include "buffer_server.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  namespace tree
+  {
+    class CContext ;
+  }
+  
+  class CContextServer
+  {
+    public:
+    
+    CContextServer(tree::CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ;
+    bool eventLoop(void) ;
+    void listen(void) ;
+    void checkPendingRequest(void) ;
+    void processRequest(int rank, char* buff,int count) ;
+    void processEvents(void) ;
+    void dispatchEvent(CEventServer& event) ;
+    void setPendingEvent(void) ;
+    bool hasPendingEvent(void) ;
+    
+    MPI_Comm intraComm ;
+    int intraCommSize ;
+    int intraCommRank ;
+    
+    MPI_Comm interComm ;
+    int commSize ;
+  
+    map<int,CServerBuffer*> buffers ;
+    map<int,MPI_Request> pendingRequest ;
+    map<int,char*> bufferRequest ;
+    
+    map<size_t,CEventServer*> events ;
+    size_t currentTimeLine ;
+    tree::CContext* context ;
+    
+    bool finished ;
+    bool pendingEvent ;
+    ~CContextServer() ;    
+  } ;
+
+}
+
+#endif
Index: /XIOS/trunk/src/cxios.cpp
===================================================================
--- /XIOS/trunk/src/cxios.cpp	(revision 306)
+++ /XIOS/trunk/src/cxios.cpp	(revision 306)
@@ -0,0 +1,62 @@
+
+#include "xmlioserver_spl.hpp"
+#include "cxios.hpp"
+#include "client_ym.hpp"
+#include "server_ym.hpp"
+#include "tree_manager.hpp"
+#include <boost/functional/hash.hpp>
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  string CXios::rootFile="./iodef.xml" ;
+  string CXios::xiosCodeId="xios.x" ;
+  
+  bool CXios::isClient ;
+  bool CXios::isServer ;
+  MPI_Comm CXios::globalComm ;
+  bool CXios::usingOasis ;
+  bool CXios::usingServer ;   
+  
+  void CXios::initialize()
+  {
+    tree::CTreeManager::ParseFile(rootFile);
+    usingServer=getin<bool>("using_server") ;
+    usingOasis=getin<bool>("using_oasis") ;
+    info.setLevel(getin<int>("info_level")) ;
+    globalComm=MPI_COMM_WORLD ;
+  }
+
+
+  void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
+  {
+     
+    initialize() ;
+    
+    isClient=true;
+    if (usingServer) isServer=false;
+    else isServer=true ;
+    
+    ym::CClient::initialize(codeId,localComm,returnComm) ;
+
+  }   
+
+  void CXios::clientFinalize(void)
+  {
+     ym::CClient::finalize() ;    
+  }   
+  
+  
+  void CXios::initServerSide(void)
+  {
+    initialize();
+
+    if (!usingServer) ERROR("void CXios::initServerSide(void)",<<"using_server is set to <false> and server initialization is called") ;
+    isClient=true;
+    isServer=false ;
+
+    ym::CServer::initialize() ;
+  } 
+  
+
+}
Index: /XIOS/trunk/src/cxios.hpp
===================================================================
--- /XIOS/trunk/src/cxios.hpp	(revision 306)
+++ /XIOS/trunk/src/cxios.hpp	(revision 306)
@@ -0,0 +1,48 @@
+#ifndef __XIOS_HPP__
+#define __XIOS_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  class CXios
+  {
+     public:
+     
+     static string rootFile ;
+     static string xiosCodeId ;
+     
+     static void initialize(void) ;
+      
+   
+     static void initClientSide(const string & codeId, MPI_Comm& localComm, MPI_Comm& returnComm) ;
+     static void initServerSide(void) ;
+     static void clientFinalize(void) ;
+   
+     template <typename T>
+     static T getin(const string& id) ;
+
+
+     static bool isClient ;
+     static bool isServer ;
+
+     static MPI_Comm globalComm ; 
+     
+     static bool usingOasis ;
+     static bool usingServer ;   
+        
+  } ;
+}
+
+#include "cxios_impl.hpp"
+
+
+
+
+
+
+
+
+
+#endif
Index: /XIOS/trunk/src/cxios_impl.hpp
===================================================================
--- /XIOS/trunk/src/cxios_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/cxios_impl.hpp	(revision 306)
@@ -0,0 +1,18 @@
+#ifndef __XIOS_IMPL_HPP__
+#define __XIOS_IMPL_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "variable.hpp"
+
+namespace xmlioserver
+{
+  template <typename T>
+  T CXios::getin(const string& id)
+  {
+    return CObjectFactory::GetObject<CVariable>("xios",id)->getData<T>() ;
+  }
+
+
+
+}
+#endif
Index: /XIOS/trunk/src/data_output.cpp
===================================================================
--- /XIOS/trunk/src/data_output.cpp	(revision 306)
+++ /XIOS/trunk/src/data_output.cpp	(revision 306)
@@ -0,0 +1,106 @@
+#include "data_output.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "context.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CDataOutput::~CDataOutput(void)
+      { /* Ne rien faire de plus */ }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CGrid> grid)
+      {
+         if (grid->domain_ref.isEmpty())
+            ERROR("CONetCDF4Adv::writeGrid(grid)",
+                   << " domain is not defined !");
+
+         if (grid->axis_ref.isEmpty())
+         {
+            this->writeGrid
+            (CObjectFactory::GetObject<tree::CDomain>(grid->domain_ref.getValue()));
+         }
+         else
+         {
+            this->writeGrid
+            (CObjectFactory::GetObject<tree::CDomain>(grid->domain_ref.getValue()),
+             CObjectFactory::GetObject<tree::CAxis>(grid->axis_ref.getValue()));
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeFile
+         (const boost::shared_ptr<tree::CFile>  file)
+      {
+         this->writeFile_(file);
+      }
+
+      void CDataOutput::closeFile(void)
+      {
+         this->closeFile_();
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CDomain> domain,
+          const boost::shared_ptr<tree::CAxis> axis)
+      {
+         this->writeDomain_(domain);
+         this->writeAxis_(axis);
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CDomain> domain)
+      {
+         this->writeDomain_(domain);
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeField
+         (const boost::shared_ptr<tree::CField> field)
+      {
+         boost::shared_ptr<tree::CContext> context =
+         CObjectFactory::GetObject<tree::CContext>(CObjectFactory::GetCurrentContextId());
+         boost::shared_ptr<date::CCalendar> calendar = context->getCalendar();
+         
+         this->writeField_(field);
+         this->writeTimeAxis_(field, calendar);
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataOutput::writeFieldGrid
+         (const boost::shared_ptr<tree::CField> field)
+      {
+         this->writeGrid(field->getRelGrid());
+      }
+      
+      //----------------------------------------------------------------
+      
+      void CDataOutput::writeFieldData(const boost::shared_ptr<tree::CField> field)
+      {
+         boost::shared_ptr<CGrid> grid =
+            CObjectFactory::GetObject<CGrid>(field->grid_ref.getValue());
+         boost::shared_ptr<CDomain> domain =
+            CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue());
+            
+//         if (domain->isEmpty()) return;
+         this->writeFieldData_(field);
+      }
+      
+      ///----------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/data_output.hpp
===================================================================
--- /XIOS/trunk/src/data_output.hpp	(revision 306)
+++ /XIOS/trunk/src/data_output.hpp	(revision 306)
@@ -0,0 +1,62 @@
+#ifndef __XMLIO_DATA_OUTPUT__
+#define __XMLIO_DATA_OUTPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "grid.hpp"
+#include "field.hpp"
+
+#include <mpi.h>
+#include <netcdf.h>
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef enum { ONE_FILE = 0, MULTI_GROUP, MULTI_FILE } EDataOutputType;
+
+            /// Ecriture ///
+            void writeFile     (const boost::shared_ptr<tree::CFile>  file);
+            void closeFile     (void);
+            void writeField    (const boost::shared_ptr<tree::CField> field);
+            void writeFieldGrid(const boost::shared_ptr<tree::CField> field);
+            void writeFieldData(const boost::shared_ptr<tree::CField> field);
+
+            virtual void definition_start(void) = 0;
+            virtual void definition_end(void)   = 0;
+
+            virtual ~CDataOutput(void);
+
+         protected:
+
+            /// Ecriture ///
+            void writeGrid(const boost::shared_ptr<tree::CGrid>   grid);
+            void writeGrid(const boost::shared_ptr<tree::CDomain> domain,
+                           const boost::shared_ptr<tree::CAxis>   axis);
+            void writeGrid(const boost::shared_ptr<tree::CDomain> domain);
+
+            virtual void writeFile_       (const boost::shared_ptr<tree::CFile>     file)   = 0;
+            virtual void closeFile_       (void)                                            = 0;
+            virtual void writeField_      (const boost::shared_ptr<tree::CField>    field)  = 0;
+            virtual void writeFieldData_  (const boost::shared_ptr<tree::CField>    field)  = 0;
+            virtual void writeDomain_     (const boost::shared_ptr<tree::CDomain>   domain) = 0;
+            virtual void writeAxis_       (const boost::shared_ptr<tree::CAxis>     axis)   = 0;
+            virtual void writeTimeAxis_   (const boost::shared_ptr<tree::CField>    field,
+                                           const boost::shared_ptr<date::CCalendar> cal)    = 0;
+
+            /// PropriÃ©tÃ©s protÃ©gÃ©es ///
+            EDataOutputType type;
+
+      }; // class CDataOutput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_DATA_OUTPUT__
Index: /XIOS/trunk/src/data_treatment.cpp
===================================================================
--- /XIOS/trunk/src/data_treatment.cpp	(revision 306)
+++ /XIOS/trunk/src/data_treatment.cpp	(revision 306)
@@ -0,0 +1,189 @@
+#include "data_treatment.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "object_factory_impl.hpp"
+
+
+namespace xmlioserver
+{
+   namespace data
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CDataTreatment::CDataTreatment (boost::shared_ptr<CContext> _ctxt)
+         : currentContext(_ctxt), enabledFiles()
+      { this->doTreatment(); }
+
+      CDataTreatment::~CDataTreatment(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      const boost::shared_ptr<CContext>
+         CDataTreatment::getCurrentContext(void) const
+      {
+         return (this->currentContext);
+      }
+
+      const std::vector<boost::shared_ptr<CFile> > &
+         CDataTreatment::getEnabledFiles (void) const
+      {
+         return (this->enabledFiles);
+      }
+      //----------------------------------------------------------------
+
+      void CDataTreatment::update_calendar(int step)
+      {
+         // Mise Ã  jour cÃŽtÃ© client
+         this->currentContext->getCalendar()->update(step);
+         if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT)
+         { // Mise Ã  jour cÃŽtÃ© serveur
+            boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient();
+            client->updateCalendar(step);
+         }
+      }
+
+      void CDataTreatment::set_timestep(const date::CDuration & duration)
+      {
+         // Mise Ã  jour cÃŽtÃ© client
+         this->currentContext->getCalendar()->setTimeStep(duration);
+         this->currentContext->timestep.setValue(duration.toString());
+         if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT)
+         { // Mise Ã  jour cÃŽtÃ© serveur
+            boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient();
+            client->setTimestep(duration);
+         }
+      }
+
+      void CDataTreatment::finalize(void)
+      {
+         // Mise Ã  jour cÃŽtÃ© client
+         if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT)
+         { // Mise Ã  jour cÃŽtÃ© serveur
+            boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient();
+            client->finalize();
+         }
+         else closeAllFile() ;
+      }
+
+      void CDataTreatment::closeAllFile(void )
+      {
+         std::vector<boost::shared_ptr<CFile> >::const_iterator
+            it = this->enabledFiles.begin(), end = this->enabledFiles.end();
+         
+         for (; it != end; it++)
+         {
+            (*it)->close();
+         }
+      }
+      //----------------------------------------------------------------
+      
+      void CDataTreatment::write_data
+                           (const StdString & fieldId,
+                            const StdString & fileId,
+                            const std::deque<ARRAY(double, 1)> & data)
+      {
+         const date::CDate & currDate =
+                this->currentContext->getCalendar()->getCurrentDate();
+         const std::vector<boost::shared_ptr<CField> > & refField=
+               CObjectFactory::GetObject<CField>(fieldId)->getAllReference();
+         std::vector<boost::shared_ptr<CField> >::const_iterator
+               it = refField.begin(), end = refField.end();
+
+         for (; it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            boost::shared_ptr<CFile>  file  = field->getRelFile();
+            
+            if (file->getId().compare(fileId) == 0)
+            {
+               if (field->updateDataServer(currDate, data))
+               {
+                  file->getDataOutput()->writeFieldData(field);
+               }
+               return;
+            }
+         }
+
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataTreatment::doTreatment(void)
+      {         
+         // RÃ©solution du calendrier
+         this->currentContext->solveCalendar();         
+         
+         // RÃ©solution des hÃ©ritages pour le context actuel.
+         this->solveAllInheritance();
+
+         //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
+         this->findEnabledFiles();
+
+         //Recherche des champs Ã  sortir (enable Ã  true + niveau de sortie correct)
+         // pour chaque fichier prÃ©cÃ©demment listÃ©.
+         this->findAllEnabledFields();
+
+         // RÃ©solution des rÃ©fÃ©rences de grilles pour chacun des champs.
+         this->solveAllGridRef();
+
+         // Traitement des opÃ©rations.
+         this->solveAllOperation();
+
+         // Nettoyage de l'arborescence
+         CContext::CleanTree();
+
+      }
+
+      void CDataTreatment::findAllEnabledFields(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            (void)this->enabledFiles[i]->getEnabledFields();
+      }
+
+      void CDataTreatment::solveAllGridRef(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            this->enabledFiles[i]->solveEFGridRef();
+      }
+
+      void CDataTreatment::solveAllOperation(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            this->enabledFiles[i]->solveEFOperation();
+      }
+
+      void CDataTreatment::solveAllInheritance(void) const
+      {
+         // RÃ©solution des hÃ©ritages descendants (cÃ d des hÃ©ritages de groupes)
+         // pour chacun des contextes.
+         this->currentContext->solveDescInheritance();
+
+         // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence au niveau des fichiers.
+          const std::vector<boost::shared_ptr<CFile> > & allFiles
+            = CObjectFactory::GetObjectVector<CFile>();
+
+         for (unsigned int i = 0; i < allFiles.size(); i++)
+            allFiles[i]->solveFieldRefInheritance();
+      }
+
+      void CDataTreatment::findEnabledFiles(void)
+      {
+         const std::vector<boost::shared_ptr<CFile> > & allFiles
+            = CObjectFactory::GetObjectVector<CFile>();
+
+         for (unsigned int i = 0; i < allFiles.size(); i++)
+            if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dÃ©fini.
+               if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixÃ© Ã  vrai.
+                  enabledFiles.push_back(allFiles[i]);
+
+         if (enabledFiles.size() == 0)
+            DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
+                  << this->currentContext->getId() << "\" !");
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace data
+} // namespace xmlioserver
Index: /XIOS/trunk/src/data_treatment.hpp
===================================================================
--- /XIOS/trunk/src/data_treatment.hpp	(revision 306)
+++ /XIOS/trunk/src/data_treatment.hpp	(revision 306)
@@ -0,0 +1,171 @@
+#ifndef __XMLIO_CDataTreatment__
+#define __XMLIO_CDataTreatment__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node_type.hpp"
+#include "mpi_manager.hpp"
+#include "data_output.hpp"
+#include "duration.hpp"
+#include "client.hpp"
+#include "xios_manager.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+   namespace data
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CDataTreatment
+      {
+         public :
+
+            /// Construteurs ///
+            CDataTreatment
+               (boost::shared_ptr<CContext> _ctxt =
+                  CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()));
+
+            CDataTreatment(const CDataTreatment & data_treatment);       // Not implemented yet.
+            CDataTreatment(const CDataTreatment * const data_treatment); // Not implemented yet.
+
+            /// Accesseurs ///
+            const boost::shared_ptr<CContext> getCurrentContext(void) const;
+            const std::vector<boost::shared_ptr<CFile> > & getEnabledFiles  (void) const;
+
+            /// Ecriture et mise Ã  jour du calendrier ///
+            void write_data(const StdString & fieldId,
+                            const StdString & fileId,
+                            const std::deque<ARRAY(double, 1)> & data);
+
+            template <StdSize N>
+               void write_data(const StdString & fieldId, const ARRAY(double, N) & data);
+
+            template <StdSize N>
+               void write_data(const StdString & fieldId, const ARRAY(float, N) & data);
+
+            void update_calendar(int step);
+            void set_timestep(const date::CDuration & duration);
+            void finalize(void) ;
+            
+            /// CrÃ©ation des sorties ///
+            template <class T> void createDataOutput(MPI_Comm comm_server = CXIOSManager::Comm_Server);
+
+           
+            /// Destructeur ///
+            ~CDataTreatment(void);
+
+         private :
+
+            /// Traitements ///
+            void doTreatment(void);
+            void closeAllFile(void ) ;
+
+            void findAllEnabledFields(void);
+            void solveAllGridRef(void);
+            void solveAllOperation(void);
+            void solveAllInheritance(void) const;
+            void findEnabledFiles(void);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            boost::shared_ptr<CContext> currentContext;
+            std::vector<boost::shared_ptr<CFile> > enabledFiles;
+     
+      }; // CDataTreatment
+
+      //----------------------------------------------------------------
+
+      template <class T>
+         void CDataTreatment::createDataOutput(MPI_Comm comm_server )
+      {
+         std::vector<boost::shared_ptr<CFile> >::const_iterator
+            it = this->enabledFiles.begin(), end = this->enabledFiles.end();
+         
+         for (; it != end; it++)
+         {
+            CXIOSManager::Comm_Server = comm_server;
+            boost::shared_ptr<CFile> file = *it;
+            StdString filename = (!file->name.isEmpty())
+                               ?   file->name.getValue() : file->getId();
+            StdOStringStream oss;
+            if (!CObjectFactory::GetObject<CContext>
+                (CObjectFactory::GetCurrentContextId())->output_dir.isEmpty())
+            	oss << CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId())->output_dir.getValue();
+            oss << filename;
+            if (!file->name_suffix.isEmpty())
+                oss << file->name_suffix.getValue();
+
+            bool multifile=true ;
+            if (!file->type.isEmpty())
+            {
+              StdString str=file->type.getValue() ; 
+              if (str.compare("one_file")==0) multifile=false ;
+              else if (str.compare("multi_file")==0) multifile=true ;
+              else ERROR("void CDataTreatment::createDataOutput(MPI_Comm comm_server)",
+                         "incorrect file <type> attribut : must be <multi_file> or <one_file>, "
+                        <<"having : <"<<str<<">") ;
+            } 
+            if (multifile) 
+            {
+              if (comm::CMPIManager::GetCommSize(comm_server) > 1)
+	               oss << "_" << comm::CMPIManager::GetCommRank(comm_server);
+            }
+            oss << ".nc";
+
+            boost::shared_ptr<io::CDataOutput> dout(new T(oss.str(), false,comm_server,multifile));
+//            file->initializeDataOutput(dout);
+         }
+      }
+
+      template <StdSize N>
+         void CDataTreatment::write_data
+            (const StdString & fieldId, const ARRAY(float, N) & data)
+      {
+         typedef typename boost::multi_array<double, N>::size_type sizetp;
+         std::vector<sizetp> shape;
+         const sizetp *	shapearr = data->shape();
+
+         shape.assign(shapearr, shapearr + N);
+         ARRAY(double, N) datad(new CArray<double, N>(shape));
+         for (StdSize i = 0; i < datad->num_elements(); i++)
+          datad->data()[i] = data->data()[i];
+
+         this->write_data(fieldId, datad);
+      }
+
+      template <StdSize N>
+         void CDataTreatment::write_data
+            (const StdString & fieldId, const ARRAY(double, N) & data)
+      {
+         const date::CDate & currDate =
+                this->currentContext->getCalendar()->getCurrentDate();
+         const date::CDuration & timestep = 
+               this->currentContext->getCalendar()->getTimeStep();
+         const std::vector<boost::shared_ptr<CField> > & refField=
+               CObjectFactory::GetObject<CField>(fieldId)->getAllReference();
+         std::vector<boost::shared_ptr<CField> >::const_iterator
+               it = refField.begin(), end = refField.end();
+         for (; it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            boost::shared_ptr<CFile>  file  = field->getRelFile();
+            if (field->updateData(data))
+            {
+               if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT)
+               { 
+                   boost::shared_ptr<comm::CClient> client = comm::CClient::GetClient();
+                   client->sendData(field->getId(), file->getId(), field->getData());
+               }
+               else
+               {
+                  file->getDataOutput()->writeFieldData(field);
+               }
+            }
+         }
+
+      }
+
+   } // namespace data
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDataTreatment__
Index: /XIOS/trunk/src/date.cpp
===================================================================
--- /XIOS/trunk/src/date.cpp	(revision 306)
+++ /XIOS/trunk/src/date.cpp	(revision 306)
@@ -0,0 +1,183 @@
+#include "date.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CDate::CDate(const CCalendar& calendar,
+                   int yr, int mth, int d,
+                   int hr, int min, int sec)
+         : relCalendar(calendar)
+         , year(yr), month(mth) , day(d)
+         , hour(hr), minute(min), second(sec)
+      {
+         if(!this->checkDate())
+         {
+            DEBUG(<< "La date initialisÃ©e a Ã©tÃ© modifiÃ©e "
+                  << "car elle Ã©tait incorrecte par rapport au calendrier souhaitÃ©.");
+         }
+      }
+
+      CDate::CDate(const CDate & date)
+            : relCalendar(date.getRelCalendar()),
+              year(date.year), month(date.month)  , day(date.day),
+              hour(date.hour), minute(date.minute), second(date.second)
+      {
+         if(!this->checkDate())
+         {
+            DEBUG(<< "La date initialisÃ©e a Ã©tÃ© modifiÃ©e "
+                  << "car elle Ã©tait incorrecte par rapport au calendrier souhaitÃ©.");
+         }
+      }
+
+      CDate::~CDate(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      CDate & CDate::operator=(const CDate & date)
+      {
+         // relCalendar = d.getRelCalendar(); << inutile si fonction bien utilisÃ©e
+         year = date.year; month  = date.month ; day    = date.day;
+         hour = date.hour; minute = date.minute; second = date.second;
+         return (*this);
+      }
+
+      StdOStream & operator<<(StdOStream & out, const CDate & date)
+      {
+         std::streamsize s = out.width (2);
+         char c = out.fill ('0');
+         out << date.day << '/';
+         s = out.width (2); c = out.fill ('0');
+         out << date.month << '/';
+         s = out.width (4); c = out.fill ('0');
+         out << date.year << '-';
+         s = out.width (2); c = out.fill ('0');
+         out << date.hour << ':';
+         s = out.width (2); c = out.fill ('0');
+         out << date.minute << ':';
+         s = out.width (2); c = out.fill ('0');
+         out << date.second;
+         
+         return (out);
+      }
+
+      StdIStream & operator>>(StdIStream & in, CDate & date) // Non testÃ©e.
+      {
+         char c = '/'; // Le caractÃšre c est utilisÃ© pour "recueillir" les sÃ©parateurs "/" et ":".
+         in >> date.day  >> c >> date.month  >> c >> date.year   >> c;
+         in >> date.hour >> c >> date.minute >> c >> date.second;
+         if(!date.checkDate())
+         {
+            DEBUG("La date initialisÃ©e (depuis une chaÃ®ne de caractÃšres) "
+                  << "a Ã©tÃ© modifiÃ©e car elle Ã©tait incorrecte "
+                  << "par rapport au calendrier souhaitÃ©.");
+         }
+         return (in);
+      }
+
+      CDate::operator Time(void) // Non vÃ©rifiÃ©e, pas optimisÃ©e ...
+      {
+         // Todo : Tester si la date courante est supÃ©rieure Ã  la date initiale.
+         Time retvalue = - relCalendar.getNbSecond(relCalendar.getInitDate())
+                         + relCalendar.getNbSecond(*this);
+
+         if ((relCalendar.getId().compare("D360")    == 0) ||
+             (relCalendar.getId().compare("AllLeap") == 0) ||
+             (relCalendar.getId().compare("NoLeap")  == 0))
+         return (retvalue + (getYear() - relCalendar.getInitDate().getYear())
+                                       * relCalendar.getYearTotalLength(*this));
+
+         for(CDate _d(relCalendar.getInitDate());
+            _d.getYear() < getYear(); _d.setYear(_d.getYear()+1))
+            retvalue += relCalendar.getYearTotalLength(_d);
+         return (retvalue);
+      }
+
+      //----------------------------------------------------------------
+
+      bool CDate::checkDate(void)
+      {
+         bool retValue = true;
+
+         // VÃ©rificatio de la valeur du mois.
+         if (month  < 1) { retValue = false; month  = 1; }
+         if (month  > relCalendar.getYearLength())
+         { retValue = false; month = relCalendar.getYearLength(); }
+
+         // VÃ©rification de la valeur du jour.
+         if (day    < 1) { retValue = false; month  = 1; }
+         if (day    > relCalendar.getMonthLength(*this))
+         { retValue = false; day = relCalendar.getMonthLength(*this); }
+
+         // VÃ©rification de la valeur de l'heure.
+         if (hour   < 0) { retValue = false; hour  = 0; }
+         if (hour   >= relCalendar.getDayLength())
+         { retValue = false; hour = relCalendar.getDayLength()-1; }
+
+         // VÃ©rification de la valeur des minutes.
+         if (minute < 0) { retValue = false; minute = 0; }
+         if (minute >= relCalendar.getHourLength())
+         { retValue = false; minute = relCalendar.getHourLength()-1; }
+
+         // VÃ©rification de la valeur des secondes.
+         if (second < 0) { retValue = false; month  = 0; }
+         if (second >= relCalendar.getMinuteLength())
+         { retValue = false; second = relCalendar.getMinuteLength()-1; }
+
+         return retValue;
+      }
+
+      //----------------------------------------------------------------
+
+      int CDate::getYear  (void) const { return (this->year  ); }
+      int CDate::getMonth (void) const { return (this->month ); }
+      int CDate::getDay   (void) const { return (this->day   ); }
+      int CDate::getHour  (void) const { return (this->hour  ); }
+      int CDate::getMinute(void) const { return (this->minute); }
+      int CDate::getSecond(void) const { return (this->second); }
+
+      //----------------------------------------------------------------
+
+      const CCalendar & CDate::getRelCalendar(void) const
+      { return (this->relCalendar); }
+
+      //----------------------------------------------------------------
+
+      void CDate::setYear  (int newyear)  { this->year  = newyear; }
+      void CDate::setMonth (int newmonth) { this->month = newmonth; }
+
+      //----------------------------------------------------------------
+
+      void CDate::addMonth (int value)
+      {// Value doit Ãªtre Ã©gale Ã  1 ou -1.
+         this->month += value;
+         if (this->month == 13) { year++; this->month = 1 ; }
+         if (this->month == 0 ) { year--; this->month = 12; }
+      }
+
+      //----------------------------------------------------------------
+
+      CDate CDate::FromString(const StdString & str, const CCalendar & calendar)
+      {
+         CDate dt(calendar);
+         StdIStringStream iss(str);
+         iss >> dt;
+         return dt;
+      }
+      
+      //----------------------------------------------------------------
+      
+       StdString CDate::toString(void) const
+      { 
+         StdOStringStream oss;
+         oss << (*this);
+         return (oss.str()); 
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
Index: /XIOS/trunk/src/date.hpp
===================================================================
--- /XIOS/trunk/src/date.hpp	(revision 306)
+++ /XIOS/trunk/src/date.hpp	(revision 306)
@@ -0,0 +1,76 @@
+#ifndef __XMLIO_CDate__
+#define __XMLIO_CDate__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "duration.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CCalendar;
+
+      class CDate
+      {
+         public :
+
+            /// Constructeurs ///
+            CDate(void);                      // Not implemented yet
+            CDate(const CCalendar & cal,
+                  int yr = 0, int mth = 1, int d   = 1,
+                  int hr = 0, int min = 0, int sec = 0);
+            CDate(const CDate & odate);
+            CDate(const CDate * const odate); // Not implemented yet
+
+            /// Destructeur ///
+            ~CDate(void);
+
+            /// OpÃ©rateurs ///
+            CDate & operator=(const CDate & date);
+            friend StdOStream & operator<<(StdOStream & out, const CDate & date);
+            friend StdIStream & operator>>(StdIStream & in, CDate & date); // Non testÃ©e.
+
+            operator Time(void);  // Retourne le nombre de secondes Ã©coulÃ©es depuis la date initiale dÃ©finie dans le calendrier.
+
+            /// Traitements ///
+            bool checkDate(void); // VÃ©rifie la validitÃ© de la date.
+
+            /// Divers accesseurs ///
+            int getYear  (void) const;
+            int getMonth (void) const;
+            int getDay   (void) const;
+            int getHour  (void) const;
+            int getMinute(void) const;
+            int getSecond(void) const;
+
+            const CCalendar & getRelCalendar(void) const;
+
+            /// Mutateurs ///
+            void setYear  (int newyear);
+            void setMonth (int newmonth);
+
+            void addMonth (int value);
+
+            /// Autres ///
+            StdString toString(void) const;
+
+         public : /* static */
+
+            static CDate FromString(const StdString & str, const CCalendar & calendar);
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            const CCalendar & relCalendar; // Calendrier liÃ© Ã  la Date.
+            int year, month, day, hour, minute, second; // AnnÃ©e, mois, ...
+
+
+      }; // class CDate;
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDate__
Index: /XIOS/trunk/src/date/allleap.cpp
===================================================================
--- /XIOS/trunk/src/date/allleap.cpp	(revision 306)
+++ /XIOS/trunk/src/date/allleap.cpp	(revision 306)
@@ -0,0 +1,38 @@
+#include "allleap.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CAllLeapCalendar::CAllLeapCalendar(const StdString & dateStr)
+         : CCalendar("AllLeap", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CAllLeapCalendar::CAllLeapCalendar(int yr, int mth, int d,
+                                         int hr, int min, int sec)
+         : CCalendar("AllLeap", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CAllLeapCalendar::~CAllLeapCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CAllLeapCalendar::getYearTotalLength(const CDate & date) const
+      { return (366 * 86400); }
+
+      int CAllLeapCalendar::getMonthLength(const CDate & date) const
+      {
+         if (date.getMonth() == 2) return (29);
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CAllLeapCalendar::getType(void) const
+      { return (StdString("all_leap")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/date/allleap.hpp
===================================================================
--- /XIOS/trunk/src/date/allleap.hpp	(revision 306)
+++ /XIOS/trunk/src/date/allleap.hpp	(revision 306)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CAllLeapCalendar__
+#define __XMLIO_CAllLeapCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAllLeapCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CAllLeapCalendar(void);                                   // Not implemented yet.
+            CAllLeapCalendar(const StdString & dateStr);
+            CAllLeapCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CAllLeapCalendar(const CAllLeapCalendar & calendar);       // Not implemented yet.
+            CAllLeapCalendar(const CAllLeapCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CAllLeapCalendar(void);
+
+      }; // class CAllLeapCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAllLeapCalendar__
Index: /XIOS/trunk/src/date/calendar_type.hpp
===================================================================
--- /XIOS/trunk/src/date/calendar_type.hpp	(revision 306)
+++ /XIOS/trunk/src/date/calendar_type.hpp	(revision 306)
@@ -0,0 +1,10 @@
+#ifndef __XMLIO_calendar_type__
+#define __XMLIO_calendar_type__
+
+#include "allleap.hpp"
+#include "d360.hpp"
+#include "gregorian.hpp"
+#include "julian.hpp"
+#include "noleap.hpp"
+
+#endif //__XMLIO_calendar_type__
Index: /XIOS/trunk/src/date/d360.cpp
===================================================================
--- /XIOS/trunk/src/date/d360.cpp	(revision 306)
+++ /XIOS/trunk/src/date/d360.cpp	(revision 306)
@@ -0,0 +1,35 @@
+#include "d360.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CD360Calendar::CD360Calendar(const StdString & dateStr)
+         : CCalendar("D360", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CD360Calendar::CD360Calendar(int yr, int mth, int d,
+                                   int hr, int min, int sec)
+         : CCalendar("D360", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CD360Calendar::~CD360Calendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CD360Calendar::getYearTotalLength(const CDate & date) const
+      { return (360 * 86400); }
+
+      int CD360Calendar::getMonthLength(const CDate & date) const
+      { return (30); }
+
+      StdString CD360Calendar::getType(void) const
+      { return (StdString("360_day")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/date/d360.hpp
===================================================================
--- /XIOS/trunk/src/date/d360.hpp	(revision 306)
+++ /XIOS/trunk/src/date/d360.hpp	(revision 306)
@@ -0,0 +1,42 @@
+#ifndef __XMLIO_CD360Calendar__
+#define __XMLIO_CD360Calendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CD360Calendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CD360Calendar(void);                                   // Not implemented yet.
+            CD360Calendar(const StdString & dateStr);
+            CD360Calendar(int yr = 0, int mth = 1, int d   = 1,
+                          int hr = 0, int min = 0, int sec = 0);
+            CD360Calendar(const CD360Calendar & calendar);       // Not implemented yet.
+            CD360Calendar(const CD360Calendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CD360Calendar(void);
+
+      }; // class CD360Calendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CD360Calendar__
+
Index: /XIOS/trunk/src/date/gregorian.cpp
===================================================================
--- /XIOS/trunk/src/date/gregorian.cpp	(revision 306)
+++ /XIOS/trunk/src/date/gregorian.cpp	(revision 306)
@@ -0,0 +1,51 @@
+#include "gregorian.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CGregorianCalendar::CGregorianCalendar(const StdString & dateStr)
+         : CCalendar("Gregorian", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CGregorianCalendar::CGregorianCalendar(int yr, int mth, int d,
+                                             int hr, int min, int sec)
+         : CCalendar("Gregorian", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CGregorianCalendar::~CGregorianCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CGregorianCalendar::getYearTotalLength(const CDate & date) const
+      { // Retourne la durÃ©e d'une annÃ©e en seconde.
+         if ((date.getYear() % 4   == 0) &&
+            ((date.getYear() % 100 != 0)  ||
+             (date.getYear() % 400 == 0)  ))
+            return (366 * 86400);
+         return (365 * 86400);
+      }
+
+      int CGregorianCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         if (date.getMonth() == 2)
+         { // Traitement du cas particulier en FÃ©vrier.
+            if ((date.getYear() % 4   == 0) &&
+               ((date.getYear() % 100 != 0) ||
+                (date.getYear() % 400 == 0) ))
+               return (29);
+            return (28);
+         }
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CGregorianCalendar::getType(void) const
+      { return (StdString("gregorian")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/date/gregorian.hpp
===================================================================
--- /XIOS/trunk/src/date/gregorian.hpp	(revision 306)
+++ /XIOS/trunk/src/date/gregorian.hpp	(revision 306)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CGregorianCalendar__
+#define __XMLIO_CGregorianCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CGregorianCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CGregorianCalendar(void);                                   // Not implemented yet.
+            CGregorianCalendar(const StdString & dateStr);
+            CGregorianCalendar(int yr = 0, int mth = 1, int d   = 1,
+                               int hr = 0, int min = 0, int sec = 0);
+            CGregorianCalendar(const CGregorianCalendar & calendar);       // Not implemented yet.
+            CGregorianCalendar(const CGregorianCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CGregorianCalendar(void);
+
+      }; // class CGregorianCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGregorianCalendar__
Index: /XIOS/trunk/src/date/julian.cpp
===================================================================
--- /XIOS/trunk/src/date/julian.cpp	(revision 306)
+++ /XIOS/trunk/src/date/julian.cpp	(revision 306)
@@ -0,0 +1,44 @@
+#include "julian.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CJulianCalendar::CJulianCalendar(const StdString & dateStr)
+         : CCalendar("Julian", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CJulianCalendar::CJulianCalendar(int yr, int mth, int d,
+                                       int hr, int min, int sec)
+         : CCalendar("Julian", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CJulianCalendar::~CJulianCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CJulianCalendar::getYearTotalLength(const CDate & date) const
+      { // Retourne la durÃ©e d'une annÃ©e en seconde.
+         if (date.getYear() % 4 == 0) return (366 * 86400);
+         return (365 * 86400);
+      }
+
+      int CJulianCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         if (date.getMonth() == 2)
+         {
+            if (date.getYear()%4 == 0) return 29;
+               return 28;
+         }
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CJulianCalendar::getType(void) const
+      { return (StdString("julian")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
Index: /XIOS/trunk/src/date/julian.hpp
===================================================================
--- /XIOS/trunk/src/date/julian.hpp	(revision 306)
+++ /XIOS/trunk/src/date/julian.hpp	(revision 306)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CJulianCalendar__
+#define __XMLIO_CJulianCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CJulianCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CJulianCalendar(void);                                   // Not implemented yet.
+            CJulianCalendar(const StdString & dateStr);
+            CJulianCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CJulianCalendar(const CJulianCalendar & calendar);       // Not implemented yet.
+            CJulianCalendar(const CJulianCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CJulianCalendar(void);
+
+      }; // class CJulianCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CJulianCalendar__
Index: /XIOS/trunk/src/date/noleap.cpp
===================================================================
--- /XIOS/trunk/src/date/noleap.cpp	(revision 306)
+++ /XIOS/trunk/src/date/noleap.cpp	(revision 306)
@@ -0,0 +1,29 @@
+#include "noleap.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CNoLeapCalendar::CNoLeapCalendar(const StdString & dateStr)
+         : CCalendar("NoLeap", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CNoLeapCalendar::CNoLeapCalendar(int yr, int mth, int d,
+                                       int hr, int min, int sec)
+         : CCalendar("NoLeap", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CNoLeapCalendar::~CNoLeapCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      StdString CNoLeapCalendar::getType(void) const
+      { return (StdString("noleap")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/date/noleap.hpp
===================================================================
--- /XIOS/trunk/src/date/noleap.hpp	(revision 306)
+++ /XIOS/trunk/src/date/noleap.hpp	(revision 306)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CNoLeapCalendar__
+#define __XMLIO_CNoLeapCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CNoLeapCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CNoLeapCalendar(void);                                   // Not implemented yet.
+            CNoLeapCalendar(const StdString & dateStr);
+            CNoLeapCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CNoLeapCalendar(const CNoLeapCalendar & calendar);       // Not implemented yet.
+            CNoLeapCalendar(const CNoLeapCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CNoLeapCalendar(void);
+
+      }; // class CNoLeapCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CNoLeapCalendar__
+
Index: /XIOS/trunk/src/declare_attribute.hpp
===================================================================
--- /XIOS/trunk/src/declare_attribute.hpp	(revision 306)
+++ /XIOS/trunk/src/declare_attribute.hpp	(revision 306)
@@ -0,0 +1,43 @@
+#ifndef __XMLIO_DECLARE_ATTRIBUTE__
+#define __XMLIO_DECLARE_ATTRIBUTE__
+
+/// ///////////////////////////// Macros ///////////////////////////// ///
+
+#define DECLARE_ATTRIBUTE(type, name)                             \
+   class name##att : public CAttributeTemplate<type>{             \
+      public :                                                    \
+         name##att(void)                                          \
+            : CAttributeTemplate<type>                            \
+            (#name, *CAttributeMap::Current)                      \
+         { /* Ne rien faire de plus */ }                          \
+         type operator=(const type & value)                       \
+         { return (CAttributeTemplate<type>::operator=(value)); } \
+         virtual ~name##att(void)                                 \
+         { /* Ne rien faire de plus */ }                          \
+   } name;
+
+#define DECLARE_ATTRIBUTE_DEF(type, name, def)                     \
+   class name##att : public CAttributeTemplate<type>{              \
+      public :                                                     \
+         name##att(void)                                           \
+            : CAttributeTemplate<type>                             \
+            (#name, def, *CAttributeMap::Current)                  \
+         { /* Ne rien faire de plus */ }                           \
+         type operator=(const type & value)                        \
+         { return (CAttributeTemplate<type>::operator=(value)); }  \
+         virtual ~name##att(void)                                  \
+         { /* Ne rien faire de plus */ }                           \
+   } name;
+
+#define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \
+   class type##Attributes : public virtual CAttributeMap { \
+      public :
+
+#define END_DECLARE_ATTRIBUTE_MAP(type)            \
+         type##Attributes (void) : CAttributeMap() \
+         { /* Ne rien faire de plus */ }           \
+         virtual ~type##Attributes (void)          \
+         { /* Ne rien faire de plus */ }           \
+   };
+
+#endif // __XMLIO_DECLARE_ATTRIBUTE__
Index: /XIOS/trunk/src/declare_group.hpp
===================================================================
--- /XIOS/trunk/src/declare_group.hpp	(revision 306)
+++ /XIOS/trunk/src/declare_group.hpp	(revision 306)
@@ -0,0 +1,58 @@
+#ifndef __XMLIO_DECLARE_GROUP__
+#define __XMLIO_DECLARE_GROUP__
+
+/// ///////////////////////////// Macros ///////////////////////////// ///
+
+#define DECLARE_GROUP(type)                                           \
+   class type##Group                                                  \
+      : public CGroupTemplate<type, type##Group, type##Attributes>    \
+   {                                                                  \
+      public:                                                         \
+         typedef type              RelChild;                          \
+         typedef type##Group       RelGroup;                          \
+         typedef type##Attributes  RelAttributes;                     \
+                                                                      \
+         type##Group(void)                                            \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> ()    \
+         { /* Ne rien faire de plus */ }                              \
+         type##Group(const StdString& _id)                            \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id) \
+         { /* Ne rien faire de plus */ }                              \
+                                                                      \
+         static ENodeType GetType(void)                               \
+         { return static_cast<ENodeType>(RelChild::GetType()+1); }    \
+                                                                      \
+         virtual ~type##Group(void)                                   \
+         { /* Ne rien faire de plus */ }                              \
+   };                                                                 \
+   typedef type##Group type##Definition
+   
+#define DECLARE_GROUP_PARSE_REDEF(type)                                  \
+   class type##Group                                                     \
+      : public CGroupTemplate<type, type##Group, type##Attributes>       \
+   {                                                                     \
+      public:                                                            \
+         typedef type              RelChild;                             \
+         typedef type##Group       RelGroup;                             \
+         typedef type##Attributes  RelAttributes;                        \
+         typedef CGroupTemplate<type, type##Group, type##Attributes>     \
+                 SuperClass;                                             \
+                                                                         \
+         type##Group(void)                                               \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> ()       \
+         { /* Ne rien faire de plus */ }                                 \
+         type##Group(const StdString& _id)                               \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id)    \
+         { /* Ne rien faire de plus */ }                                 \
+                                                                         \
+         static ENodeType GetType(void)                                  \
+         { return static_cast<ENodeType>(RelChild::GetType()+1); }       \
+                                                                         \
+         virtual void parse(xml::CXMLNode & node, bool withAttr = true); \
+                                                                         \
+         virtual ~type##Group(void)                                      \
+         { /* Ne rien faire de plus */ }                                 \
+   };                                                                    \
+   typedef type##Group type##Definition
+
+#endif // __XMLIO_DECLARE_GROUP__
Index: /XIOS/trunk/src/duration.cpp
===================================================================
--- /XIOS/trunk/src/duration.cpp	(revision 306)
+++ /XIOS/trunk/src/duration.cpp	(revision 306)
@@ -0,0 +1,145 @@
+#include "duration.hpp"
+#include "date.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      const CDuration Year   = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0},
+                      Month  = {0.0, 1.0, 0.0, 0.0, 0.0, 0.0},
+                      Week   = {0.0, 0.0, 7.0, 0.0, 0.0, 0.0},
+                      Day    = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0},
+                      Hour   = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0},
+                      Minute = {0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
+                      Second = {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};
+
+      ///---------------------------------------------------------------
+
+      CDuration & CDuration::operator=(const CDuration & duration)
+      {
+         year = duration.year;  month  = duration.month ; day    = duration.day;
+         hour = duration.hour;  minute = duration.minute; second = duration.second;
+         return (*this);
+      }
+
+      StdOStream & operator<<(StdOStream & out, const CDuration & duration)
+      {
+         StdOStringStream sout;
+         bool testValue = true;
+         if(duration.year   != 0.0) { testValue = false; sout << duration.year   << "y " ; }
+         if(duration.month  != 0.0) { testValue = false; sout << duration.month  << "mo "; }
+         if(duration.day    != 0.0) { testValue = false; sout << duration.day    << "d " ; }
+         if(duration.hour   != 0.0) { testValue = false; sout << duration.hour   << "h " ; }
+         if(duration.minute != 0.0) { testValue = false; sout << duration.minute << "mi "; }
+         if(duration.second != 0.0 || testValue)       { sout << duration.second << "s " ; }
+
+         // << suppression de l'espace en fin de chaÃ®ne.
+         out << (sout.str().substr(0, sout.str().size()-1));
+         return (out);
+      }
+
+      StdIStream & operator>>(StdIStream & in , CDuration & duration)
+      {
+         duration.year = duration.month  = duration.day    =
+         duration.hour = duration.minute = duration.second = 0.0;
+         double v = 1.0;
+         char   c = '/';
+         while (!in.eof())
+         {
+               if (!(in >> v >> c)) 
+               {
+                 //DEBUG("----> Pb StdIStream & operator>>(StdIStream & in , CDuration & duration)") ;
+                 //if (in.eof())  DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)") ;
+               }
+               if (in.eof())  
+               {
+                 //DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)") ;
+                 break ;
+               }
+               switch (c)
+               {
+                  case 'y': duration.year   = v; break;
+                  case 'd': duration.day    = v; break;
+                  case 'h': duration.hour   = v; break;
+                  case 's': duration.second = v; break;
+                  case 'm':
+                  {
+                     in >> c;
+                     if     (c == 'i') duration.minute = v;
+                     else if(c == 'o') duration.month  = v;
+                     else
+                     {
+                        StdString valc("m"); valc.append(1, c);
+                        //DEBUG("La chaine \"" << valc << "\" ne permet pas de dÃ©finir une unitÃ© de durÃ©e.");
+                        break;
+                     }
+                     break;
+                  }
+                  default:
+                     StdString valc; valc.append(1, c);
+                     //DEBUG("La chaine \"" << valc << "\" ne permet pas de dÃ©finir une unitÃ© de durÃ©e.");
+                     break;
+               }
+            }
+            return (in);
+      }
+
+      //-----------------------------------------------------------------
+
+      bool CDuration::isNone(void) const
+      {
+         if ((year == 0) && (month  == 0) && (day    == 0) &&
+             (hour == 0) && (minute == 0) && (second == 0))
+            return (true);
+         return (false);
+      }
+
+      //-----------------------------------------------------------------
+
+      CDuration & CDuration::resolve(const CCalendar & c)
+      {
+         // Simplification de l'Ã©criture des minutes.
+         second += modf(minute, &minute) * (float)c.getMinuteLength();
+         minute += int(second)/c.getMinuteLength(); second = int(second)%c.getMinuteLength();
+
+         // Simplification de l'Ã©criture des heures.
+         minute += modf(hour , &hour) * (float)c.getHourLength();
+         hour   += int(minute)/c.getHourLength(); minute = int(minute)%c.getHourLength();
+
+         // Simplification de l'Ã©criture des jours.
+         hour   += modf(day, &day) * (float)c.getDayLength();
+         day    += int(hour)  /c.getDayLength(); hour   = int(hour)%c.getDayLength();
+
+         // > Aucune Ã©quivalence jour - mois fixÃ©e par avance. //
+
+         // Simplification de l'Ã©criture des annÃ©es.
+         month  += modf(year, &year) * (float)c.getYearLength();
+         year   += int(month) /c.getYearLength(); month  = int(month)%c.getYearLength();
+         return (*this);
+      }
+
+      //-----------------------------------------------------------------
+
+      StdString CDuration::toString(void) const
+      {
+         const  CDuration & own = *this;
+         StdOStringStream oss; oss << own;
+         return (oss.str());
+      }
+
+      CDuration CDuration::FromString(const StdString & str)
+      {
+         CDuration dr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
+         StdIStringStream iss(str); iss >> dr;
+         return (dr);
+      }
+
+      ///---------------------------------------------------------------
+
+
+   } // namespace date
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/duration.hpp
===================================================================
--- /XIOS/trunk/src/duration.hpp	(revision 306)
+++ /XIOS/trunk/src/duration.hpp	(revision 306)
@@ -0,0 +1,54 @@
+#ifndef __XMLIO_CDuration__
+#define __XMLIO_CDuration__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef long long int Time;
+      class CCalendar;
+
+      ///---------------------------------------------------------------
+      typedef struct _duration
+      {
+         public :
+
+            /// OpÃ©rateurs ///
+            struct _duration & operator=(const struct _duration& duration);
+
+            friend StdOStream & operator<<(StdOStream & out, const struct _duration& duration);
+            friend StdIStream & operator>>(StdIStream & in , struct _duration& duration);
+
+            /// Test ///
+            bool isNone(void) const;
+
+            /// Traitement ///
+            struct _duration & resolve(const CCalendar & calendar);
+
+            /// Autres ///
+            StdString toString(void) const;
+
+         public: /* static */
+
+            static struct _duration FromString(const StdString & str);
+
+            /// PropriÃ©tÃ©s publiques ///
+            double year, month, day, hour, minute, second;
+
+      } CDuration;
+
+      ///---------------------------------------------------------------
+
+      const extern CDuration Year, Month , Week  , Day    ,
+                             Hour, Minute, Second, NoneDu ;
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDuration__
Index: /XIOS/trunk/src/event_client.cpp
===================================================================
--- /XIOS/trunk/src/event_client.cpp	(revision 306)
+++ /XIOS/trunk/src/event_client.cpp	(revision 306)
@@ -0,0 +1,90 @@
+#include "xmlioserver_spl.hpp"
+#include "event_client.hpp"
+#include "buffer_out.hpp"
+#include "message.hpp"
+#include "type.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+   CEventClient::CEventClient(int classId_,int typeId_)
+   {
+     classId=classId_ ;
+     typeId=typeId_ ;
+   }
+   
+   void CEventClient::push(int rank,int nbSender,CMessage & msg)
+   {
+     nbSenders.push_back(nbSender) ;
+     ranks.push_back(rank) ;
+     messages.push_back(&msg) ;
+   }
+
+   bool CEventClient::isEmpty(void)
+   {
+     return ranks.empty() ;
+   }
+
+   list<int> CEventClient::getRanks(void)
+   {
+     return ranks ;
+   }
+   
+   list<int> CEventClient::getSizes(void)
+   {
+     list<CMessage*>::iterator it ;
+     list<int> sizes ;
+     size_t headerSize=sizeof(int)+sizeof(classId)+sizeof(typeId) ;
+     
+     for(it=messages.begin();it!=messages.end();++it) sizes.push_back((*it)->size()+headerSize) ;
+     return sizes ;
+   }
+   
+   void CEventClient::send(list<CBufferOut*>& buffers)
+   {
+     list<CBufferOut*>::iterator itBuff ;
+     list<CMessage*>::iterator itMsg ;
+     list<int>::iterator itSenders ;
+     
+     for(itBuff=buffers.begin(),itMsg=messages.begin(),itSenders=nbSenders.begin();itBuff!=buffers.end();++itBuff,++itMsg,++itSenders)
+     {
+       **itBuff<<*itSenders<<classId<<typeId<<**itMsg ;
+     }
+   }   
+/*
+   CEventClient::CEventClient(CContextClient& client_,int nbSender_,list<int>& serverList_)
+   {
+     client=&client_ ;
+     nbSender=nbSender_ ;
+     serverList=serverList_ ;
+     
+     client->registerEvent(*this) ;
+   }
+
+   list<CBufferOut*> CEventClient::newEvent(int classId, int type, list<int> sizes)
+   {
+     list<int>::iterator it ;
+     list<CBufferOut*>::iterator itBuff;
+     
+     
+     CMessage msg;
+     
+     msg<<nbSender<<classId<<type ;    
+     
+     for(it=sizes.begin();it!=sizes.end();it++) *it+=msg.size() ;
+     list<CBufferOut*> buffers=client->newEvent(*this,sizes) ;
+
+     for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) *(*itBuff)<<msg ;  
+     
+     return buffers ;
+   
+   }
+          
+   void CEventClient::send(void)
+   {
+     client->sendEvent(*this) ;
+   }
+
+*/   
+   
+}
Index: /XIOS/trunk/src/event_client.hpp
===================================================================
--- /XIOS/trunk/src/event_client.hpp	(revision 306)
+++ /XIOS/trunk/src/event_client.hpp	(revision 306)
@@ -0,0 +1,34 @@
+#ifndef __EVENT_CLIENT_HPP__
+#define __EVENT_CLIENT_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "buffer_out.hpp" ;
+#include "message.hpp" ;
+
+namespace xmlioserver
+{
+ 
+  class CEventClient
+  {
+    public:
+    
+//    CEventClient(CContextClient& client,int nbSender,list<int>& serverList);  
+    CEventClient(int classId, int typeId);
+    void push(int rank,int nbSender, CMessage& msg) ;  
+
+//    list<CBufferOut*> newEvent(int classId, int type, list<int> sizes) ;
+    list<int> getRanks(void) ;
+    list<int> getSizes(void) ;
+    void send(list<CBufferOut*>&) ;   
+    bool isEmpty(void) ;
+    list<int> ranks ;
+    list<int> nbSenders ;
+    list<CMessage*> messages ;
+//    CContextClient* client ;
+    int classId ;
+    int typeId ;
+  } ;
+
+}
+
+#endif
Index: /XIOS/trunk/src/event_server.cpp
===================================================================
--- /XIOS/trunk/src/event_server.cpp	(revision 306)
+++ /XIOS/trunk/src/event_server.cpp	(revision 306)
@@ -0,0 +1,64 @@
+#include "xmlioserver_spl.hpp"
+#include "buffer_in.hpp"
+#include "type.hpp"
+#include "event_server.hpp"
+#include "buffer_server.hpp"
+
+namespace xmlioserver
+{
+
+  void CEventServer::push(int rank,CServerBuffer* serverBuffer,char* startBuffer,int size)
+  {
+    CBufferIn buffer(startBuffer,size) ;
+    size_t timeLine ;
+    int myClassId ;
+    int myType ;
+    int myNbSender ;
+  
+    buffer>>size>>timeLine>>myNbSender>>myClassId>>myType ;
+  
+    if (subEvents.empty())
+    {  
+      nbSender=myNbSender ;
+      classId=myClassId;
+      type=myType ;
+    }
+    else
+    {
+      if (nbSender!=myNbSender || classId!=myClassId || type!=myType)
+        ERROR("void CEventServer::push(int rank,char* startBuffer,int size)",
+             "Callers of an event are not coherent") ;
+    }
+
+    SSubEvent ev ;
+    ev.rank=rank ;
+    ev.serverBuffer=serverBuffer ;
+    ev.buffer=new CBufferIn(buffer.ptr(),buffer.remain()) ;
+    ev.size=size ;  
+    subEvents.push_back(ev) ;
+  
+    if (subEvents.size()>nbSender)
+    {
+        ERROR("void CEventServer::push(int rank,CServerBuffer* serverBuffer,char* startBuffer,int size)",
+              "Callers of an event are not coherent") ;
+    }
+  
+  }
+
+  bool CEventServer::isFull(void)  
+  {
+    return (nbSender==subEvents.size()) ;
+  }
+
+  CEventServer::~CEventServer()
+  {
+    list<SSubEvent>::iterator it;
+
+    for(it=subEvents.begin();it!=subEvents.end();it++)
+    {
+      it->serverBuffer->freeBuffer(it->size) ;
+      delete it->buffer ;
+    }
+  }
+
+}
Index: /XIOS/trunk/src/event_server.hpp
===================================================================
--- /XIOS/trunk/src/event_server.hpp	(revision 306)
+++ /XIOS/trunk/src/event_server.hpp	(revision 306)
@@ -0,0 +1,38 @@
+#ifndef __EVENT_SERVER_HPP__
+#define __EVENT_SERVER_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "buffer_in.hpp"
+#include "buffer_server.hpp"
+
+namespace xmlioserver
+{
+
+  class CEventServer
+  {
+    public:
+    
+    int classId ;
+    int type ;
+    int nbSender ;
+
+
+    void push(int rank,CServerBuffer* serverBuffer ,char* startBuffer,int size) ;
+
+    struct SSubEvent
+    {
+      int rank ;
+      CServerBuffer* serverBuffer ;
+      CBufferIn*  buffer ;
+      int size ;
+    } ;
+    
+    list<SSubEvent> subEvents ;    
+    
+    bool isFull(void) ;
+    ~CEventServer() ; 
+  } ;
+
+}
+
+#endif
Index: /XIOS/trunk/src/exception.cpp
===================================================================
--- /XIOS/trunk/src/exception.cpp	(revision 306)
+++ /XIOS/trunk/src/exception.cpp	(revision 306)
@@ -0,0 +1,55 @@
+#include "exception.hpp"
+
+/// boost headers ///
+#include <boost/cast.hpp>
+
+namespace xmlioserver
+{
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+   CException::CException(void)
+      : CObject(), desc_rethrow(true)
+   { /* Ne rien faire de plus */ }
+
+   CException::CException(const StdString & id)
+      : CObject(id), desc_rethrow(true)
+   { /* Ne rien faire de plus */ }
+
+   CException::CException(const CException & exception)
+      : std::basic_ios<char>()
+      , CObject(exception.getId())
+      , StdOStringStream()
+      , desc_rethrow(false)
+   { (*this) << exception.str(); }
+
+   CException::~CException(void)
+   { 
+      if (desc_rethrow)
+#ifdef __XIOS_NOABORT
+        throw (*this); 
+#else
+      std::cerr << this->getMessage() << std::endl;
+      abort();
+#endif
+   }
+
+   //---------------------------------------------------------------
+
+   StdString CException::getMessage(void) const
+   {
+      StdOStringStream oss;
+      oss << "> Error [" << this->getId() << "] : " << this->str();
+      return (oss.str());
+   }
+
+   StdOStringStream &  CException::getStream(void)
+   { return (*boost::polymorphic_cast<StdOStringStream*>(this)); }
+
+   StdString CException::toString(void) const
+   { return (StdString(this->getMessage())); }
+
+   void CException::fromString(const StdString & str)
+   { this->str(str); }
+
+   //---------------------------------------------------------------
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/exception.hpp
===================================================================
--- /XIOS/trunk/src/exception.hpp	(revision 306)
+++ /XIOS/trunk/src/exception.hpp	(revision 306)
@@ -0,0 +1,56 @@
+#ifndef __XMLIO_CException__
+#define __XMLIO_CException__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "object.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CException
+      : private CObject, public StdOStringStream
+   {
+         typedef CObject SuperClass;
+
+      public :
+
+         /// Constructeurs ///
+         CException(void);
+         explicit CException(const StdString & id);
+         CException(const CException & exception);
+         CException(const CException * const exception); // Not implemented.
+
+         /// Accesseurs ///
+         StdString getMessage(void) const;
+         StdOStringStream & getStream(void);
+
+         /// Destructeur ///
+         virtual ~CException(void);
+
+         /// Autre ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         bool desc_rethrow; // throw destructor
+
+   }; // CException
+} // namespace xmlioserver
+
+/// //////////////////////////// Macros //////////////////////////// ///
+
+#define INFO(x) \
+   "In file \'" __FILE__ "\', line " << __LINE__ << " -> " x << std::endl;
+
+#ifdef __XIOS_DEBUG
+#  define DEBUG(x) std::clog << "> Debug " << INFO(x)
+#else
+#  define DEBUG(x)
+#endif
+
+#define ERROR(id, x)  CException(id).getStream() << INFO(x)
+
+#endif // __XMLIO_CException__
Index: /XIOS/trunk/src/fortran/axis_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/axis_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/axis_interface.f90	(revision 306)
@@ -0,0 +1,63 @@
+MODULE AXIS_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_set_axis_name(axis_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axis_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_axis_name
+
+      SUBROUTINE cxios_set_axis_standard_name(axis_hdl, standard_name, standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axis_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_axis_standard_name
+
+      SUBROUTINE cxios_set_axis_long_name(axis_hdl, long_name, long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE       :: axis_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: long_name
+         INTEGER  (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_axis_long_name
+
+      SUBROUTINE cxios_set_axis_unit(axis_hdl, unit, unit_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE       :: axis_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: unit
+         INTEGER  (kind = C_INT)     , VALUE        :: unit_size
+      END SUBROUTINE cxios_set_axis_unit
+
+      SUBROUTINE cxios_set_axis_size(axis_hdl, size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+         INTEGER (kind = C_INT)     , VALUE :: size
+      END SUBROUTINE cxios_set_axis_size
+
+      SUBROUTINE cxios_set_axis_zvalue(axis_hdl, zvalue, zvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: axis_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: zvalue
+         INTEGER (kind = C_INT)     , VALUE        :: zvalue_extent1
+      END SUBROUTINE cxios_set_axis_zvalue
+      
+      SUBROUTINE cxios_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_axis_handle_create
+
+      SUBROUTINE cxios_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_axis_valid_id
+
+   END INTERFACE
+     
+END MODULE AXIS_INTERFACE
Index: /XIOS/trunk/src/fortran/axisgroup_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/axisgroup_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/axisgroup_interface.f90	(revision 306)
@@ -0,0 +1,63 @@
+MODULE AXISGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_set_axisgroup_name(axisgroup_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axisgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_axisgroup_name
+
+      SUBROUTINE cxios_set_axisgroup_standard_name(axisgroup_hdl, standard_name, standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axisgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_axisgroup_standard_name
+
+      SUBROUTINE cxios_set_axisgroup_long_name(axisgroup_hdl, long_name, long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axisgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: long_name
+         INTEGER  (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_axisgroup_long_name
+
+      SUBROUTINE cxios_set_axisgroup_unit(axisgroup_hdl, unit, unit_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: axisgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: unit
+         INTEGER  (kind = C_INT)     , VALUE        :: unit_size
+      END SUBROUTINE cxios_set_axisgroup_unit
+
+      SUBROUTINE cxios_set_axisgroup_size(axisgroup_hdl, size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: size
+      END SUBROUTINE cxios_set_axisgroup_size
+
+      SUBROUTINE cxios_set_axisgroup_zvalue(axisgroup_hdl, zvalue, zvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: axisgroup_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: zvalue
+         INTEGER (kind = C_INT)     , VALUE        :: zvalue_extent1
+      END SUBROUTINE cxios_set_axisgroup_zvalue
+  
+      SUBROUTINE cxios_axisgroup_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_axisgroup_handle_create
+
+      SUBROUTINE cxios_axisgroup_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_axisgroup_valid_id
+
+   END INTERFACE
+     
+END MODULE AXISGROUP_INTERFACE
Index: /XIOS/trunk/src/fortran/context_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/context_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/context_interface.f90	(revision 306)
@@ -0,0 +1,58 @@
+MODULE CONTEXT_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_set_context_calendar_type(context_hdl, calendar_type ,calendar_type_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: context_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: calendar_type
+         INTEGER  (kind = C_INT)     , VALUE        :: calendar_type_size
+      END SUBROUTINE cxios_set_context_calendar_type
+
+      SUBROUTINE cxios_set_context_start_date(context_hdl, start_date ,start_date_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: context_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: start_date
+         INTEGER  (kind = C_INT)     , VALUE        :: start_date_size
+      END SUBROUTINE cxios_set_context_start_date
+
+      SUBROUTINE cxios_set_context_output_dir(context_hdl, output_dir ,output_dir_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: context_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: output_dir
+         INTEGER  (kind = C_INT)     , VALUE        :: output_dir_size
+      END SUBROUTINE cxios_set_context_output_dir
+      
+      SUBROUTINE cxios_context_handle_create(ret, idt, idt_size) BIND(C)
+         import C_CHAR, C_INTPTR_T, C_INT
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_context_handle_create
+      
+      SUBROUTINE cxios_context_set_current(context, withswap) BIND(C)
+         import C_BOOL, C_INT, C_INTPTR_T
+         INTEGER (kind = C_INTPTR_T), VALUE :: context
+         LOGICAL (kind = C_BOOL)    , VALUE :: withswap
+      END SUBROUTINE cxios_context_set_current
+
+      SUBROUTINE cxios_context_create(context, context_id, context_id_size, calendar_type, &
+                                     year, month, day, hour, minute, second) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: context
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: context_id
+         INTEGER  (kind = C_INT)     , VALUE        :: context_id_size
+         INTEGER  (kind = C_INT)     , VALUE        :: calendar_type, year, month, day, hour, minute, second
+      END SUBROUTINE cxios_context_create
+
+      SUBROUTINE cxios_context_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_context_valid_id
+
+   END INTERFACE
+     
+END MODULE CONTEXT_INTERFACE
Index: /XIOS/trunk/src/fortran/domain_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/domain_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/domain_interface.f90	(revision 306)
@@ -0,0 +1,218 @@
+MODULE DOMAIN_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+       
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+       
+      SUBROUTINE cxios_set_domain_name(domain_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_domain_name
+
+      SUBROUTINE cxios_set_domain_standard_name(domain_hdl, standard_name, standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_domain_standard_name
+
+      SUBROUTINE cxios_set_domain_long_name(domain_hdl, long_name, long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: long_name
+         INTEGER  (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_domain_long_name
+
+      SUBROUTINE cxios_set_domain_domain_group_ref(domain_hdl, domain_group_ref, domain_group_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: domain_group_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: domain_group_ref_size
+      END SUBROUTINE cxios_set_domain_domain_group_ref
+
+      SUBROUTINE cxios_set_domain_ni_glo(domain_hdl, ni_glo) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ni_glo
+      END SUBROUTINE cxios_set_domain_ni_glo
+
+      SUBROUTINE cxios_set_domain_nj_glo(domain_hdl, nj_glo) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: nj_glo
+      END SUBROUTINE cxios_set_domain_nj_glo
+
+      SUBROUTINE cxios_set_domain_ibegin(domain_hdl, ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ibegin
+      END SUBROUTINE cxios_set_domain_ibegin
+
+      SUBROUTINE cxios_set_domain_iend(domain_hdl, iend) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: iend
+      END SUBROUTINE cxios_set_domain_iend
+
+      SUBROUTINE cxios_set_domain_ni(domain_hdl, ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ni
+      END SUBROUTINE cxios_set_domain_ni
+
+      SUBROUTINE cxios_set_domain_jbegin(domain_hdl, jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: jbegin
+      END SUBROUTINE cxios_set_domain_jbegin
+
+      SUBROUTINE cxios_set_domain_jend(domain_hdl, jend) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: jend
+      END SUBROUTINE cxios_set_domain_jend
+
+      SUBROUTINE cxios_set_domain_nj(domain_hdl, nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: nj
+      END SUBROUTINE cxios_set_domain_nj
+
+      SUBROUTINE cxios_set_domain_mask(domain_hdl, mask, mask_extent1, mask_extent2) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         LOGICAL(kind = C_BOOL)     , DIMENSION(*) :: mask
+         INTEGER (kind = C_INT)     , VALUE        :: mask_extent1
+         INTEGER (kind = C_INT)     , VALUE        :: mask_extent2
+      END SUBROUTINE cxios_set_domain_mask
+
+      SUBROUTINE cxios_set_domain_data_dim(domain_hdl, data_dim) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_dim
+      END SUBROUTINE cxios_set_domain_data_dim
+
+      SUBROUTINE cxios_set_domain_data_ni(domain_hdl, data_ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_ni
+      END SUBROUTINE cxios_set_domain_data_ni
+
+      SUBROUTINE cxios_set_domain_data_nj(domain_hdl, data_nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_nj
+      END SUBROUTINE cxios_set_domain_data_nj
+
+      SUBROUTINE cxios_set_domain_data_ibegin(domain_hdl, data_ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_ibegin
+      END SUBROUTINE cxios_set_domain_data_ibegin
+
+      SUBROUTINE cxios_set_domain_data_jbegin(domain_hdl, data_jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_jbegin
+      END SUBROUTINE cxios_set_domain_data_jbegin
+
+      SUBROUTINE cxios_set_domain_zoom_ni(domain_hdl, zoom_ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ni
+      END SUBROUTINE cxios_set_domain_zoom_ni
+
+      SUBROUTINE cxios_set_domain_zoom_nj(domain_hdl, zoom_nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_nj
+      END SUBROUTINE cxios_set_domain_zoom_nj
+
+      SUBROUTINE cxios_set_domain_zoom_ibegin(domain_hdl, zoom_ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ibegin
+      END SUBROUTINE cxios_set_domain_zoom_ibegin
+
+      SUBROUTINE cxios_set_domain_zoom_jbegin(domain_hdl, zoom_jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_jbegin
+      END SUBROUTINE cxios_set_domain_zoom_jbegin
+
+      SUBROUTINE cxios_set_domain_zoom_ni_loc(domain_hdl, zoom_ni_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ni_loc
+      END SUBROUTINE cxios_set_domain_zoom_ni_loc
+
+      SUBROUTINE cxios_set_domain_zoom_nj_loc(domain_hdl, zoom_nj_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_nj_loc
+      END SUBROUTINE cxios_set_domain_zoom_nj_loc
+
+      SUBROUTINE cxios_set_domain_zoom_ibegin_loc(domain_hdl, zoom_ibegin_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ibegin_loc
+      END SUBROUTINE cxios_set_domain_zoom_ibegin_loc
+
+      SUBROUTINE cxios_set_domain_zoom_jbegin_loc(domain_hdl, zoom_jbegin_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_jbegin_loc
+      END SUBROUTINE cxios_set_domain_zoom_jbegin_loc
+
+      SUBROUTINE cxios_set_domain_data_n_index(domain_hdl, data_n_index) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_n_index
+      END SUBROUTINE cxios_set_domain_data_n_index
+
+      SUBROUTINE cxios_set_domain_data_i_index(domain_hdl, data_i_index, data_i_index_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         INTEGER (kind = C_INT)     , DIMENSION(*) :: data_i_index
+         INTEGER (kind = C_INT)     , VALUE        :: data_i_index_extent1
+      END SUBROUTINE cxios_set_domain_data_i_index
+
+      SUBROUTINE cxios_set_domain_data_j_index(domain_hdl, data_j_index, data_j_index_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         INTEGER (kind = C_INT)     , DIMENSION(*) :: data_j_index
+         INTEGER (kind = C_INT)     , VALUE        :: data_j_index_extent1
+      END SUBROUTINE cxios_set_domain_data_j_index
+
+      SUBROUTINE cxios_set_domain_lonvalue(domain_hdl, lonvalue, lonvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: lonvalue
+         INTEGER (kind = C_INT)     , VALUE        :: lonvalue_extent1
+      END SUBROUTINE cxios_set_domain_lonvalue
+
+      SUBROUTINE cxios_set_domain_latvalue(domain_hdl, latvalue, latvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domain_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: latvalue
+         INTEGER (kind = C_INT)     , VALUE        :: latvalue_extent1
+      END SUBROUTINE cxios_set_domain_latvalue
+       
+      SUBROUTINE cxios_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_domain_handle_create
+
+      SUBROUTINE cxios_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_domain_valid_id
+
+   END INTERFACE
+       
+END MODULE DOMAIN_INTERFACE
Index: /XIOS/trunk/src/fortran/domaingroup_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/domaingroup_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/domaingroup_interface.f90	(revision 306)
@@ -0,0 +1,218 @@
+MODULE DOMAINGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+       
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+       
+      SUBROUTINE cxios_set_domaingroup_name(domaingroup_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_domaingroup_name
+
+      SUBROUTINE cxios_set_domaingroup_standard_name(domaingroup_hdl, standard_name, standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_domaingroup_standard_name
+
+      SUBROUTINE cxios_set_domaingroup_long_name(domaingroup_hdl, long_name, long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: long_name
+         INTEGER  (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_domaingroup_long_name
+
+      SUBROUTINE cxios_set_domaingroup_domain_group_ref(domaingroup_hdl, domain_group_ref, domain_group_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: domain_group_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: domain_group_ref_size
+      END SUBROUTINE cxios_set_domaingroup_domain_group_ref
+
+      SUBROUTINE cxios_set_domaingroup_ni_glo(domaingroup_hdl, ni_glo) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ni_glo
+      END SUBROUTINE cxios_set_domaingroup_ni_glo
+
+      SUBROUTINE cxios_set_domaingroup_nj_glo(domaingroup_hdl, nj_glo) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: nj_glo
+      END SUBROUTINE cxios_set_domaingroup_nj_glo
+
+      SUBROUTINE cxios_set_domaingroup_ibegin(domaingroup_hdl, ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ibegin
+      END SUBROUTINE cxios_set_domaingroup_ibegin
+
+      SUBROUTINE cxios_set_domaingroup_iend(domaingroup_hdl, iend) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: iend
+      END SUBROUTINE cxios_set_domaingroup_iend
+
+      SUBROUTINE cxios_set_domaingroup_ni(domaingroup_hdl, ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: ni
+      END SUBROUTINE cxios_set_domaingroup_ni
+
+      SUBROUTINE cxios_set_domaingroup_jbegin(domaingroup_hdl, jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: jbegin
+      END SUBROUTINE cxios_set_domaingroup_jbegin
+
+      SUBROUTINE cxios_set_domaingroup_jend(domaingroup_hdl, jend) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: jend
+      END SUBROUTINE cxios_set_domaingroup_jend
+
+      SUBROUTINE cxios_set_domaingroup_nj(domaingroup_hdl, nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: nj
+      END SUBROUTINE cxios_set_domaingroup_nj
+
+      SUBROUTINE cxios_set_domaingroup_mask(domaingroup_hdl, mask, mask_extent1, mask_extent2) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         LOGICAL(kind = C_BOOL)     , DIMENSION(*) :: mask
+         INTEGER (kind = C_INT)     , VALUE        :: mask_extent1
+         INTEGER (kind = C_INT)     , VALUE        :: mask_extent2
+      END SUBROUTINE cxios_set_domaingroup_mask
+
+      SUBROUTINE cxios_set_domaingroup_data_dim(domaingroup_hdl, data_dim) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_dim
+      END SUBROUTINE cxios_set_domaingroup_data_dim
+
+      SUBROUTINE cxios_set_domaingroup_data_ni(domaingroup_hdl, data_ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_ni
+      END SUBROUTINE cxios_set_domaingroup_data_ni
+
+      SUBROUTINE cxios_set_domaingroup_data_nj(domaingroup_hdl, data_nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_nj
+      END SUBROUTINE cxios_set_domaingroup_data_nj
+
+      SUBROUTINE cxios_set_domaingroup_data_ibegin(domaingroup_hdl, data_ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_ibegin
+      END SUBROUTINE cxios_set_domaingroup_data_ibegin
+
+      SUBROUTINE cxios_set_domaingroup_data_jbegin(domaingroup_hdl, data_jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE  :: data_jbegin
+      END SUBROUTINE cxios_set_domaingroup_data_jbegin
+
+      SUBROUTINE cxios_set_domaingroup_zoom_ni(domaingroup_hdl, zoom_ni) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ni
+      END SUBROUTINE cxios_set_domaingroup_zoom_ni
+
+      SUBROUTINE cxios_set_domaingroup_zoom_nj(domaingroup_hdl, zoom_nj) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_nj
+      END SUBROUTINE cxios_set_domaingroup_zoom_nj
+
+      SUBROUTINE cxios_set_domaingroup_zoom_ibegin(domaingroup_hdl, zoom_ibegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ibegin
+      END SUBROUTINE cxios_set_domaingroup_zoom_ibegin
+
+      SUBROUTINE cxios_set_domaingroup_zoom_jbegin(domaingroup_hdl, zoom_jbegin) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_jbegin
+      END SUBROUTINE cxios_set_domaingroup_zoom_jbegin
+
+      SUBROUTINE cxios_set_domaingroup_zoom_ni_loc(domaingroup_hdl, zoom_ni_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ni_loc
+      END SUBROUTINE cxios_set_domaingroup_zoom_ni_loc
+
+      SUBROUTINE cxios_set_domaingroup_zoom_nj_loc(domaingroup_hdl, zoom_nj_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_nj_loc
+      END SUBROUTINE cxios_set_domaingroup_zoom_nj_loc
+
+      SUBROUTINE cxios_set_domaingroup_zoom_ibegin_loc(domaingroup_hdl, zoom_ibegin_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_ibegin_loc
+      END SUBROUTINE cxios_set_domaingroup_zoom_ibegin_loc
+
+      SUBROUTINE cxios_set_domaingroup_zoom_jbegin_loc(domaingroup_hdl, zoom_jbegin_loc) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: zoom_jbegin_loc
+      END SUBROUTINE cxios_set_domaingroup_zoom_jbegin_loc
+
+      SUBROUTINE cxios_set_domaingroup_data_n_index(domaingroup_hdl, data_n_index) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: data_n_index
+      END SUBROUTINE cxios_set_domaingroup_data_n_index
+
+      SUBROUTINE cxios_set_domaingroup_data_i_index(domaingroup_hdl, data_i_index, data_i_index_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , DIMENSION(*) :: data_i_index
+         INTEGER (kind = C_INT)     , VALUE        :: data_i_index_extent1
+      END SUBROUTINE cxios_set_domaingroup_data_i_index
+
+      SUBROUTINE cxios_set_domaingroup_data_j_index(domaingroup_hdl, data_j_index, data_j_index_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         INTEGER (kind = C_INT)     , DIMENSION(*) :: data_j_index
+         INTEGER (kind = C_INT)     , VALUE        :: data_j_index_extent1
+      END SUBROUTINE cxios_set_domaingroup_data_j_index
+
+      SUBROUTINE cxios_set_domaingroup_lonvalue(domaingroup_hdl, lonvalue, lonvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: lonvalue
+         INTEGER (kind = C_INT)     , VALUE        :: lonvalue_extent1
+      END SUBROUTINE cxios_set_domaingroup_lonvalue
+
+      SUBROUTINE cxios_set_domaingroup_latvalue(domaingroup_hdl, latvalue, latvalue_extent1) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: domaingroup_hdl
+         REAL    (kind = C_DOUBLE)  , DIMENSION(*) :: latvalue
+         INTEGER (kind = C_INT)     , VALUE        :: latvalue_extent1
+      END SUBROUTINE cxios_set_domaingroup_latvalue
+      
+      SUBROUTINE cxios_domaingroup_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_domaingroup_handle_create
+
+      SUBROUTINE cxios_domaingroup_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_domaingroup_valid_id
+
+   END INTERFACE
+       
+END MODULE DOMAINGROUP_INTERFACE
Index: /XIOS/trunk/src/fortran/field_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/field_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/field_interface.f90	(revision 306)
@@ -0,0 +1,116 @@
+MODULE FIELD_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+   
+      SUBROUTINE cxios_set_field_name(field_hdl, name ,name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_field_name
+
+      SUBROUTINE cxios_set_field_standard_name(field_hdl, standard_name ,standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_field_standard_name
+
+      SUBROUTINE cxios_set_field_long_name(field_hdl, long_name ,long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: long_name
+         INTEGER (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_field_long_name
+
+      SUBROUTINE cxios_set_field_unit(field_hdl, unit ,unit_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: unit
+         INTEGER  (kind = C_INT)     , VALUE        :: unit_size
+      END SUBROUTINE cxios_set_field_unit
+
+      SUBROUTINE cxios_set_field_operation(field_hdl, operation ,operation_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+         INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+      END SUBROUTINE cxios_set_field_operation
+
+      SUBROUTINE cxios_set_field_freq_op(field_hdl, freq_op ,freq_op_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: freq_op
+         INTEGER  (kind = C_INT)     , VALUE        :: freq_op_size
+      END SUBROUTINE cxios_set_field_freq_op
+
+      SUBROUTINE cxios_set_field_level(field_hdl, level) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+         INTEGER (kind = C_INT)     , VALUE :: level
+      END SUBROUTINE cxios_set_field_level
+
+      SUBROUTINE cxios_set_field_prec(field_hdl, prec) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+         INTEGER (kind = C_INT)     , VALUE :: prec
+      END SUBROUTINE cxios_set_field_prec
+
+      SUBROUTINE cxios_set_field_enabled(field_hdl, enabled) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+         LOGICAL (kind = C_BOOL)    , VALUE :: enabled
+         END SUBROUTINE cxios_set_field_enabled
+
+      SUBROUTINE cxios_set_field_domain_ref(field_hdl, domain_ref ,domain_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: domain_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: domain_ref_size
+      END SUBROUTINE cxios_set_field_domain_ref
+
+      SUBROUTINE cxios_set_field_axis_ref(field_hdl, axis_ref ,axis_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: axis_ref_size
+      END SUBROUTINE cxios_set_field_axis_ref
+
+      SUBROUTINE cxios_set_field_grid_ref(field_hdl, grid_ref ,grid_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: grid_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: grid_ref_size
+      END SUBROUTINE cxios_set_field_grid_ref
+
+      SUBROUTINE cxios_set_field_field_ref(field_hdl, field_ref ,field_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: field_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: field_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: field_ref_size
+      END SUBROUTINE cxios_set_field_field_ref
+
+      SUBROUTINE cxios_set_field_default_value(field_hdl, default_value) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+         REAL    (kind = C_DOUBLE)  , VALUE :: default_value
+      END SUBROUTINE cxios_set_field_default_value
+   
+      SUBROUTINE cxios_field_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_field_handle_create
+
+      SUBROUTINE cxios_field_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_field_valid_id
+
+   END INTERFACE
+   
+END MODULE FIELD_INTERFACE
Index: /XIOS/trunk/src/fortran/fieldgroup_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/fieldgroup_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/fieldgroup_interface.f90	(revision 306)
@@ -0,0 +1,116 @@
+MODULE FIELDGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+   
+      SUBROUTINE cxios_set_fieldgroup_name(fieldgroup_hdl, name ,name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_fieldgroup_name
+
+      SUBROUTINE cxios_set_fieldgroup_standard_name(fieldgroup_hdl, standard_name ,standard_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: standard_name
+         INTEGER  (kind = C_INT)     , VALUE        :: standard_name_size
+      END SUBROUTINE cxios_set_fieldgroup_standard_name
+
+      SUBROUTINE cxios_set_fieldgroup_long_name(fieldgroup_hdl, long_name ,long_name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: long_name
+         INTEGER (kind = C_INT)     , VALUE        :: long_name_size
+      END SUBROUTINE cxios_set_fieldgroup_long_name
+
+      SUBROUTINE cxios_set_fieldgroup_unit(fieldgroup_hdl, unit ,unit_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: unit
+         INTEGER  (kind = C_INT)     , VALUE        :: unit_size
+      END SUBROUTINE cxios_set_fieldgroup_unit
+
+      SUBROUTINE cxios_set_fieldgroup_operation(fieldgroup_hdl, operation ,operation_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+         INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+      END SUBROUTINE cxios_set_fieldgroup_operation
+
+      SUBROUTINE cxios_set_fieldgroup_freq_op(fieldgroup_hdl, freq_op ,freq_op_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: freq_op
+         INTEGER  (kind = C_INT)     , VALUE        :: freq_op_size
+      END SUBROUTINE cxios_set_fieldgroup_freq_op
+
+      SUBROUTINE cxios_set_fieldgroup_level(fieldgroup_hdl, level) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: level
+      END SUBROUTINE cxios_set_fieldgroup_level
+
+      SUBROUTINE cxios_set_fieldgroup_prec(fieldgroup_hdl, prec) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: prec
+      END SUBROUTINE cxios_set_fieldgroup_prec
+
+      SUBROUTINE cxios_set_fieldgroup_enabled(fieldgroup_hdl, enabled) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+         LOGICAL (kind = C_BOOL)    , VALUE :: enabled
+         END SUBROUTINE cxios_set_fieldgroup_enabled
+
+      SUBROUTINE cxios_set_fieldgroup_domain_ref(fieldgroup_hdl, domain_ref ,domain_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: domain_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: domain_ref_size
+      END SUBROUTINE cxios_set_fieldgroup_domain_ref
+
+      SUBROUTINE cxios_set_fieldgroup_axis_ref(fieldgroup_hdl, axis_ref ,axis_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: axis_ref_size
+      END SUBROUTINE cxios_set_fieldgroup_axis_ref
+
+      SUBROUTINE cxios_set_fieldgroup_grid_ref(fieldgroup_hdl, grid_ref ,grid_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: grid_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: grid_ref_size
+      END SUBROUTINE cxios_set_fieldgroup_grid_ref
+
+      SUBROUTINE cxios_set_fieldgroup_field_ref(fieldgroup_hdl, field_ref ,field_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: fieldgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: field_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: field_ref_size
+      END SUBROUTINE cxios_set_fieldgroup_field_ref
+
+      SUBROUTINE cxios_set_fieldgroup_default_value(fieldgroup_hdl, default_value) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+         REAL    (kind = C_DOUBLE)  , VALUE :: default_value
+      END SUBROUTINE cxios_set_fieldgroup_default_value
+      
+      SUBROUTINE cxios_fieldgroup_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_fieldgroup_handle_create
+
+      SUBROUTINE cxios_fieldgroup_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_fieldgroup_valid_id
+   
+   END INTERFACE
+   
+END MODULE FIELDGROUP_INTERFACE
Index: /XIOS/trunk/src/fortran/file_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/file_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/file_interface.f90	(revision 306)
@@ -0,0 +1,69 @@
+MODULE FILE_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+   
+      SUBROUTINE cxios_set_file_name(file_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: file_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_file_name
+
+      SUBROUTINE cxios_set_file_description(file_hdl, description, description_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: file_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: description
+         INTEGER  (kind = C_INT)     , VALUE        :: description_size
+      END SUBROUTINE cxios_set_file_description
+      
+      SUBROUTINE cxios_set_file_name_suffix(file_hdl, name_suffix, name_suffix_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: file_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name_suffix
+         INTEGER  (kind = C_INT)     , VALUE        :: name_suffix_size
+      END SUBROUTINE cxios_set_file_name_suffix
+
+      SUBROUTINE cxios_set_file_output_freq(file_hdl, output_freq, output_freq_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: file_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: output_freq
+         INTEGER  (kind = C_INT)     , VALUE        :: output_freq_size
+      END SUBROUTINE cxios_set_file_output_freq
+
+      SUBROUTINE cxios_set_file_output_level(file_hdl, output_level) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+         INTEGER (kind = C_INT)     , VALUE :: output_level
+      END SUBROUTINE cxios_set_file_output_level
+
+      SUBROUTINE cxios_set_file_enabled(file_hdl, enabled) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+         LOGICAL (kind = C_BOOL)    , VALUE :: enabled
+      END SUBROUTINE cxios_set_file_enabled
+   
+      SUBROUTINE cxios_file_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_file_handle_create
+
+      SUBROUTINE cxios_file_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_file_valid_id
+
+     SUBROUTINE cxios_set_file_type(file_hdl, type, type_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: file_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+         INTEGER  (kind = C_INT)     , VALUE        :: type_size
+      END SUBROUTINE cxios_set_file_type
+      
+   END INTERFACE
+   
+END MODULE FILE_INTERFACE
Index: /XIOS/trunk/src/fortran/filegroup_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/filegroup_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/filegroup_interface.f90	(revision 306)
@@ -0,0 +1,69 @@
+MODULE FILEGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+   
+      SUBROUTINE cxios_set_filegroup_name(filegroup_hdl, name ,name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: filegroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+         INTEGER  (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_filegroup_name
+
+      SUBROUTINE cxios_set_filegroup_description(filegroup_hdl, description ,description_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: filegroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: description
+         INTEGER  (kind = C_INT)     , VALUE        :: description_size
+      END SUBROUTINE cxios_set_filegroup_description
+      
+      SUBROUTINE cxios_set_filegroup_name_suffix(filegroup_hdl, name_suffix ,name_suffix_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: filegroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name_suffix
+         INTEGER  (kind = C_INT)     , VALUE        :: name_suffix_size
+      END SUBROUTINE cxios_set_filegroup_name_suffix
+
+      SUBROUTINE cxios_set_filegroup_output_freq(filegroup_hdl, output_freq ,output_freq_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: filegroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: output_freq
+         INTEGER  (kind = C_INT)     , VALUE        :: output_freq_size
+      END SUBROUTINE cxios_set_filegroup_output_freq
+
+      SUBROUTINE cxios_set_filegroup_output_level(filegroup_hdl, output_level) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+         INTEGER (kind = C_INT)     , VALUE :: output_level
+      END SUBROUTINE cxios_set_filegroup_output_level
+
+      SUBROUTINE cxios_set_filegroup_enabled(filegroup_hdl, enabled) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+         LOGICAL (kind = C_BOOL)    , VALUE :: enabled
+      END SUBROUTINE cxios_set_filegroup_enabled
+      
+      SUBROUTINE cxios_filegroup_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_filegroup_handle_create
+
+      SUBROUTINE cxios_filegroup_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_filegroup_valid_id
+
+      SUBROUTINE cxios_set_filegroup_type(filegroup_hdl, type ,type_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: filegroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+         INTEGER  (kind = C_INT)     , VALUE        :: type_size
+      END SUBROUTINE cxios_set_filegroup_type
+      
+   END INTERFACE
+   
+END MODULE FILEGROUP_INTERFACE
Index: /XIOS/trunk/src/fortran/grid_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/grid_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/grid_interface.f90	(revision 306)
@@ -0,0 +1,50 @@
+MODULE GRID_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_set_grid_name(grid_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: grid_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: name
+         INTEGER (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_grid_name
+
+      SUBROUTINE cxios_set_grid_description(grid_hdl, description, description_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: grid_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: description
+         INTEGER (kind = C_INT)     , VALUE        :: description_size
+      END SUBROUTINE cxios_set_grid_description
+
+      SUBROUTINE cxios_set_grid_domain_ref(grid_hdl, domain_ref, domain_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: grid_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: domain_ref
+         INTEGER (kind = C_INT)     , VALUE        :: domain_ref_size
+      END SUBROUTINE cxios_set_grid_domain_ref
+
+      SUBROUTINE cxios_set_grid_axis_ref(grid_hdl, axis_ref, axis_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: grid_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: axis_ref_size
+      END SUBROUTINE cxios_set_grid_axis_ref
+      
+      SUBROUTINE cxios_grid_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_grid_handle_create
+
+      SUBROUTINE cxios_grid_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_grid_valid_id
+
+   END INTERFACE
+     
+END MODULE GRID_INTERFACE
Index: /XIOS/trunk/src/fortran/gridgroup_interface.f90
===================================================================
--- /XIOS/trunk/src/fortran/gridgroup_interface.f90	(revision 306)
+++ /XIOS/trunk/src/fortran/gridgroup_interface.f90	(revision 306)
@@ -0,0 +1,50 @@
+MODULE GRIDGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_set_gridgroup_name(gridgroup_hdl, name, name_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: gridgroup_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: name
+         INTEGER (kind = C_INT)     , VALUE        :: name_size
+      END SUBROUTINE cxios_set_gridgroup_name
+
+      SUBROUTINE cxios_set_gridgroup_description(gridgroup_hdl, description, description_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: gridgroup_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: description
+         INTEGER (kind = C_INT)     , VALUE        :: description_size
+      END SUBROUTINE cxios_set_gridgroup_description
+
+      SUBROUTINE cxios_set_gridgroup_domain_ref(gridgroup_hdl, domain_ref, domain_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER (kind = C_INTPTR_T), VALUE        :: gridgroup_hdl
+         CHARACTER(kind = C_CHAR)   , DIMENSION(*) :: domain_ref
+         INTEGER (kind = C_INT)     , VALUE        :: domain_ref_size
+      END SUBROUTINE cxios_set_gridgroup_domain_ref
+
+      SUBROUTINE cxios_set_gridgroup_axis_ref(gridgroup_hdl, axis_ref, axis_ref_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: gridgroup_hdl
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_ref
+         INTEGER  (kind = C_INT)     , VALUE        :: axis_ref_size
+      END SUBROUTINE cxios_set_gridgroup_axis_ref
+      
+      SUBROUTINE cxios_domaingroup_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_domaingroup_handle_create
+
+      SUBROUTINE cxios_gridgroup_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_gridgroup_valid_id
+
+   END INTERFACE
+     
+END MODULE GRIDGROUP_INTERFACE
Index: /XIOS/trunk/src/fortran/iaxis.F90
===================================================================
--- /XIOS/trunk/src/fortran/iaxis.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/iaxis.F90	(revision 306)
@@ -0,0 +1,330 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IAXIS
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE AXIS_INTERFACE
+   USE AXISGROUP_INTERFACE
+   
+   TYPE XAxisHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XAxisHandle
+   
+   TYPE XAxisGroupHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XAxisGroupHandle
+
+   TYPE txios(axis)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(axis)
+   
+   TYPE txios(axisgroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(axisgroup)
+   
+   !----------------------------------------------------------------------------
+   INTERFACE set_axis_attributes
+      MODULE PROCEDURE set_axis_attributes_id,set_axis_attributes_hdl
+   END INTERFACE  
+   
+   INTERFACE set_axis_group_attributes
+      MODULE PROCEDURE set_axisgroup_attributes_id,set_axisgroup_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+
+         
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+
+   SUBROUTINE xios(set_axis_attr)(axis_id, name, standard_name, long_name, unit, size, value)
+      IMPLICIT NONE
+      TYPE(txios(axis))                                     :: axis_hdl
+      CHARACTER(len = *)                        , INTENT(IN) :: axis_id
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value(:)
+      
+      CALL xios(get_axis_handle)(axis_id,axis_hdl)
+      CALL xios(set_axis_attr_hdl_)(axis_hdl, name, standard_name, long_name, unit, size, value)
+
+   END SUBROUTINE xios(set_axis_attr)
+   
+
+   SUBROUTINE xios(set_axis_attr_hdl)(axis_hdl, name, standard_name, long_name, unit, size, value)
+      IMPLICIT NONE
+      TYPE(txios(axis))                        , INTENT(IN) :: axis_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value(:)
+
+      CALL xios(set_axis_attr_hdl_)(axis_hdl, name, standard_name, long_name, unit, size, value)
+
+   END SUBROUTINE xios(set_axis_attr_hdl)
+   
+   
+   SUBROUTINE xios(set_axis_attr_hdl_)(axis_hdl, name_, standard_name_, long_name_, unit_, size_, value_)
+      IMPLICIT NONE
+      TYPE(txios(axis))                        , INTENT(IN) :: axis_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value_(:)
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_axis_name(axis_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_axis_standard_name(axis_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_axis_long_name(axis_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_axis_unit(axis_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(size_))           THEN
+         CALL cxios_set_axis_size(axis_hdl%daddr, size_)
+      END IF
+      IF (PRESENT(value_))         THEN
+         CALL cxios_set_axis_zvalue(axis_hdl%daddr, value_, size(value_, 1))
+      END IF
+      
+   END SUBROUTINE xios(set_axis_attr_hdl_)
+
+   
+   SUBROUTINE xios(set_axisgroup_attr)(axisgroup_id, name, standard_name, long_name, unit, size, value)
+      IMPLICIT NONE
+      TYPE(txios(axisgroup))                                :: axisgroup_hdl
+      CHARACTER(len = *)                        , INTENT(IN) :: axisgroup_id
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value(:)
+
+      CALL xios(get_axisgroup_handle)(axisgroup_id,axisgroup_hdl)
+      CALL xios(set_axisgroup_attr_hdl_)(axisgroup_hdl, name, standard_name, long_name, unit, size, value)
+
+   END SUBROUTINE xios(set_axisgroup_attr)
+   
+
+   SUBROUTINE xios(set_axisgroup_attr_hdl)(axisgroup_hdl, name, standard_name, long_name, unit, size, value)
+      IMPLICIT NONE
+      TYPE(txios(axisgroup))                   , INTENT(IN) :: axisgroup_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value(:)
+
+      CALL xios(set_axisgroup_attr_hdl_)(axisgroup_hdl, name, standard_name, long_name, unit, size, value)      
+
+   END SUBROUTINE xios(set_axisgroup_attr_hdl)
+
+      
+   SUBROUTINE xios(set_axisgroup_attr_hdl_)(axisgroup_hdl, name_, standard_name_, long_name_, unit_, size_, value_)
+      IMPLICIT NONE
+      TYPE(txios(axisgroup))                   , INTENT(IN) :: axisgroup_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL(kind=8), dimension(*), OPTIONAL, INTENT(IN) :: value_(:)
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_axisgroup_name(axisgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_axisgroup_standard_name(axisgroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_axisgroup_long_name(axisgroup_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_axisgroup_unit(axisgroup_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(size_))           THEN
+         CALL cxios_set_axisgroup_size(axisgroup_hdl%daddr, size_)
+      END IF
+      IF (PRESENT(value_))         THEN
+         CALL cxios_set_axisgroup_zvalue(axisgroup_hdl%daddr, value_, size(value_, 1))
+      END IF
+   END SUBROUTINE xios(set_axisgroup_attr_hdl_)
+   
+
+   SUBROUTINE xios(get_axis_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      TYPE(txios(axis)) , INTENT(OUT):: ret
+      CALL cxios_axis_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE xios(get_axis_handle)
+   
+   SUBROUTINE xios(get_axisgroup_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)    , INTENT(IN) :: idt      
+      TYPE(txios(axisgroup)), INTENT(OUT):: ret
+
+      CALL cxios_axisgroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_axisgroup_handle)
+
+   LOGICAL FUNCTION xios(is_valid_axis)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      
+      CALL cxios_axis_valid_id(val, idt, len(idt))
+      xios(is_valid_axis) = val
+
+   END FUNCTION  xios(is_valid_axis)
+
+   LOGICAL FUNCTION xios(is_valid_axisgroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_axisgroup_valid_id(val, idt, len(idt))
+      xios(is_valid_axisgroup) = val
+
+   END FUNCTION  xios(is_valid_axisgroup)
+   
+
+
+
+!!!!!!!!!!!!! anciennes interfaces  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE set_axis_attributes_id(axis_id, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+      IMPLICIT NONE
+      TYPE(XAxisHandle)                                      :: axis_hdl
+      CHARACTER(len = *)                        , INTENT(IN) :: axis_id
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL    (kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: zvalue_(:)
+      
+      CALL axis_handle_create(axis_hdl, axis_id)
+      CALL set_axis_attributes_hdl(axis_hdl, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+
+   END SUBROUTINE set_axis_attributes_id
+
+   SUBROUTINE set_axis_attributes_hdl(axis_hdl, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+      IMPLICIT NONE
+      TYPE(XAxisHandle)                         , INTENT(IN) :: axis_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL    (kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: zvalue_(:)
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_axis_name(axis_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_axis_standard_name(axis_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_axis_long_name(axis_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_axis_unit(axis_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(size_))           THEN
+         CALL cxios_set_axis_size(axis_hdl%daddr, size_)
+      END IF
+      IF (PRESENT(zvalue_))         THEN
+         CALL cxios_set_axis_zvalue(axis_hdl%daddr, zvalue_, size(zvalue_, 1))
+      END IF
+   END SUBROUTINE set_axis_attributes_hdl
+   
+   SUBROUTINE set_axisgroup_attributes_id(axisgroup_id, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+      IMPLICIT NONE
+      TYPE(XAxisGroupHandle)                                 :: axisgroup_hdl
+      CHARACTER(len = *)                        , INTENT(IN) :: axisgroup_id
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL    (kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: zvalue_(:)
+      
+      CALL axisgroup_handle_create(axisgroup_hdl, axisgroup_id)
+      CALL set_axisgroup_attributes_hdl(axisgroup_hdl, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+
+   END SUBROUTINE set_axisgroup_attributes_id
+   
+   SUBROUTINE set_axisgroup_attributes_hdl(axisgroup_hdl, name_, standard_name_, long_name_, unit_, size_, zvalue_)
+      IMPLICIT NONE
+      TYPE(XAxisGroupHandle)                    , INTENT(IN) :: axisgroup_hdl
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)              , OPTIONAL, INTENT(IN) :: unit_
+      INTEGER                         , OPTIONAL, INTENT(IN) :: size_
+      REAL    (kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: zvalue_(:)
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_axisgroup_name(axisgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_axisgroup_standard_name(axisgroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_axisgroup_long_name(axisgroup_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_axisgroup_unit(axisgroup_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(size_))           THEN
+         CALL cxios_set_axisgroup_size(axisgroup_hdl%daddr, size_)
+      END IF
+      IF (PRESENT(zvalue_))         THEN
+         CALL cxios_set_axisgroup_zvalue(axisgroup_hdl%daddr, zvalue_, size(zvalue_, 1))
+      END IF
+   END SUBROUTINE set_axisgroup_attributes_hdl
+
+   SUBROUTINE axis_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XAxisHandle) , INTENT(OUT):: ret
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      CALL cxios_axis_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE axis_handle_create
+   
+   SUBROUTINE axisgroup_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XAxisGroupHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)    , INTENT(IN) :: idt      
+      CALL cxios_axisgroup_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE axisgroup_handle_create
+
+   LOGICAL FUNCTION axis_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_axis_valid_id(val, idt, len(idt));
+      axis_valid_id = val
+   END FUNCTION  axis_valid_id
+
+   LOGICAL FUNCTION axisgroup_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_axisgroup_valid_id(val, idt, len(idt));
+      axisgroup_valid_id = val
+   END FUNCTION  axisgroup_valid_id
+
+END MODULE IAXIS
Index: /XIOS/trunk/src/fortran/icaxis.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icaxis.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icaxis.cpp	(revision 306)
@@ -0,0 +1,177 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "attribute_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+   
+   typedef xmlioserver::tree::CAxis      * XAxisPtr;
+   typedef xmlioserver::tree::CAxisGroup * XAxisGroupPtr;
+
+   // ------------------------- Attributs des axes -----------------------------
+   void cxios_set_axis_name 
+      (XAxisPtr axis_hdl, const char * name , int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      axis_hdl->name.setValue(name_str);
+      axis_hdl->sendAttributToServer(axis_hdl->name) ;
+   }
+
+   void cxios_set_axis_standard_name
+      (XAxisPtr axis_hdl, const char * standard_name , int standard_name_size)
+   {
+      std::string standard_name_str; 
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      axis_hdl->standard_name.setValue(standard_name_str); 
+      axis_hdl->sendAttributToServer(axis_hdl->standard_name); 
+  }
+    
+   void cxios_set_axis_long_name 
+      (XAxisPtr axis_hdl, const char * long_name , int long_name_size)
+   {
+      std::string long_name_str; 
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      axis_hdl->long_name.setValue(long_name_str);
+      axis_hdl->sendAttributToServer(axis_hdl->long_name) ;
+   }
+
+   void cxios_set_axis_unit 
+      (XAxisPtr axis_hdl, const char * unit , int unit_size)
+   {
+      std::string unit_str; 
+      if (!cstr2string(unit, unit_size, unit_str)) return;
+
+      axis_hdl->unit.setValue(unit_str);
+      axis_hdl->sendAttributToServer(axis_hdl->unit) ;
+   }
+    
+   void cxios_set_axis_size(XAxisPtr axis_hdl, int size)
+   {
+      axis_hdl->size.setValue(size);
+      axis_hdl->sendAttributToServer(axis_hdl->size) ;
+   }
+
+   void cxios_set_axis_zvalue 
+      (XAxisPtr axis_hdl, const double * zvalue , int zvalue_extent1)
+   {
+      ARRAY(double, 1) zvalue_val(new CArray<double, 1>(boost::extents [zvalue_extent1]));
+      std::copy(zvalue, &(zvalue[zvalue_val->num_elements()]), zvalue_val->data());
+
+      axis_hdl->zvalue.setValue(zvalue_val);
+      axis_hdl->sendAttributToServer(axis_hdl->zvalue) ;
+
+   }
+   
+   // -------------------- Attributs des groupes d'axes -------------------------
+   
+   void cxios_set_axisgroup_name 
+      (XAxisGroupPtr axisgroup_hdl, const char * name , int name_size)
+   {
+      std::string name_str;
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      axisgroup_hdl->name.setValue(name_str);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->name) ;
+   }
+
+   void cxios_set_axisgroup_standard_name
+      (XAxisGroupPtr axisgroup_hdl, const char * standard_name , int standard_name_size)
+   {
+      std::string standard_name_str;
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      axisgroup_hdl->standard_name.setValue(standard_name_str);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->standard_name) ;
+   }
+    
+   void cxios_set_axisgroup_long_name 
+      (XAxisGroupPtr axisgroup_hdl, const char * long_name , int long_name_size)
+   {
+      std::string long_name_str;
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      axisgroup_hdl->long_name.setValue(long_name_str);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->long_name) ;
+   }
+
+   void cxios_set_axisgroup_unit 
+      (XAxisGroupPtr axisgroup_hdl, const char * unit , int unit_size)
+   {
+      std::string unit_str;
+      if (!cstr2string(unit, unit_size, unit_str)) return;
+
+      axisgroup_hdl->unit.setValue(unit_str);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->unit) ;
+   }
+    
+   void cxios_set_axisgroup_size(XAxisGroupPtr axisgroup_hdl, int size)
+   {
+      axisgroup_hdl->size.setValue(size);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->size) ;
+   }
+
+   void cxios_set_axisgroup_zvalue 
+      (XAxisGroupPtr axisgroup_hdl, const double * zvalue , int zvalue_extent1)
+   {
+      ARRAY(double, 1) zvalue_val(new CArray<double, 1>(boost::extents [zvalue_extent1]));
+      std::copy(zvalue, &(zvalue[zvalue_val->num_elements()]), zvalue_val->data());
+
+      axisgroup_hdl->zvalue.setValue(zvalue_val);
+      axisgroup_hdl->sendAttributToServer(axisgroup_hdl->zvalue) ;
+   }
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   
+   void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CAxis>(id).get();
+   }
+   
+   void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CAxisGroup>(id).get();
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CAxis>(id);
+   }
+
+   void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CAxisGroup>(id);
+   }
+   
+} // extern "C"
Index: /XIOS/trunk/src/fortran/iccontext.cpp
===================================================================
--- /XIOS/trunk/src/fortran/iccontext.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/iccontext.cpp	(revision 306)
@@ -0,0 +1,159 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "calendar_type.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef enum { D360 = 0 , ALLLEAP, NOLEAP, JULIAN, GREGORIAN } XCalendarType ;
+
+   typedef xmlioserver::tree::CContext * XContextPtr;
+
+   // ------------------------- Attributs des contextes ------------------------
+   
+   
+   void cxios_set_context_calendar_type(XContextPtr context_hdl, const char * calendar_type, int calendar_type_size)
+   {
+      std::string calendar_type_str; 
+      if (!cstr2string(calendar_type, calendar_type_size, calendar_type_str)) return;
+      context_hdl->calendar_type.setValue(calendar_type_str);
+      context_hdl->sendAttributToServer(context_hdl->calendar_type) ;
+   }
+   
+   void cxios_set_context_start_date(XContextPtr context_hdl, const char * start_date, int start_date_size)
+   {
+      std::string start_date_str; 
+      if (!cstr2string(start_date, start_date_size, start_date_str)) return;
+
+      context_hdl->start_date.setValue(start_date_str);
+      context_hdl->sendAttributToServer(context_hdl->start_date) ; 
+   }
+   
+   void cxios_set_context_output_dir(XContextPtr context_hdl, const char * output_dir, int output_dir_size)
+   {
+      std::string output_dir_str; 
+      if (!cstr2string(output_dir, output_dir_size, output_dir_str)) return;
+
+      context_hdl->output_dir.setValue(output_dir_str);
+      context_hdl->sendAttributToServer(context_hdl->output_dir) ; 
+   }
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   
+   void cxios_context_handle_create (XContextPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      std::vector<boost::shared_ptr<xmlioserver::tree::CContext> > def_vector =
+            xmlioserver::tree::CContext::GetContextGroup()->getChildList();
+
+      for (std::size_t i = 0; i < def_vector.size(); i++)
+	   {
+          if (def_vector[i]->getId().compare(id) == 0)
+          *_ret = def_vector[i].get();
+          return;
+      }
+      // Lever une execption ici
+   }
+   
+   // ------------------------ Changements de contextes ------------------------
+   
+   void cxios_context_set_current(XContextPtr context, bool withswap)
+   {
+      CTreeManager::SetCurrentContextId(context->getId());
+   }
+   
+   // ------------------------ CrÃ©ation de contexte ----------------------------
+   
+   void cxios_context_create(XContextPtr * context,
+                            const char  * context_id,
+                            int           context_id_size,
+                            XCalendarType calendar_type,
+                            int           year,
+                            int           month,
+                            int           day,
+                            int           hour,
+                            int           minute,
+                            int           second)
+   {
+      std::string context_id_str; 
+      if (!cstr2string(context_id, context_id_size, context_id_str)) return;
+      try
+      {
+         boost::shared_ptr<xmlioserver::tree::CContext> _context =
+            CTreeManager::CreateContext(context_id_str);
+         *context = _context.get();
+         switch(calendar_type)
+         {
+            case (D360)     :
+               _context->setCalendar(boost::shared_ptr<xmlioserver::date::CCalendar>
+                  (new xmlioserver::date::CD360Calendar
+                     (year, month, day, hour, minute, second)));
+               break;
+            case (ALLLEAP)  :
+               _context->setCalendar(boost::shared_ptr<xmlioserver::date::CCalendar>
+                  (new xmlioserver::date::CAllLeapCalendar
+                     (year, month, day, hour, minute, second)));
+               break;
+            case (NOLEAP)   :
+               _context->setCalendar(boost::shared_ptr<xmlioserver::date::CCalendar>
+                  (new xmlioserver::date::CNoLeapCalendar
+                     (year, month, day, hour, minute, second)));
+               break;
+            case (JULIAN)   :
+               _context->setCalendar(boost::shared_ptr<xmlioserver::date::CCalendar>
+                  (new xmlioserver::date::CJulianCalendar
+                     (year, month, day, hour, minute, second)));
+               break;
+            case (GREGORIAN):
+               _context->setCalendar(boost::shared_ptr<xmlioserver::date::CCalendar>
+                  (new xmlioserver::date::CGregorianCalendar
+                     (year, month, day, hour, minute, second)));
+                break;
+            default:
+               std::cerr << "Le calendrier n'est pas identifiÃ©" << std::endl;
+               exit (EXIT_FAILURE);
+         }
+      }
+      catch (xmlioserver::CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_context_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      std::vector<boost::shared_ptr<xmlioserver::tree::CContext> > def_vector =
+            xmlioserver::tree::CContext::GetContextGroup()->getChildList();
+
+      for (std::size_t i = 0; i < def_vector.size(); i++)
+	   {
+          if (def_vector[i]->getId().compare(id) == 0)
+          *_ret = true;
+      }
+     *_ret = false;
+   }
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icdata.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icdata.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icdata.cpp	(revision 306)
@@ -0,0 +1,308 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include <string>
+#include <iostream>
+
+
+#include "xmlioserver.hpp"
+#include "oasis_cinterface.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+#include "mpi_manager.hpp"
+#include "buffer.hpp"
+#include "cxios.hpp"
+#include "client_ym.hpp"
+#include "field.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+   
+   typedef enum { NETCDF4 = 0 } XFileType;
+   
+   typedef xmlioserver::tree::CContext * XContextPtr;
+
+   // -------------------- Traitement des donnÃ©es ------------------------------
+   void cxios_init_server(void)
+   {
+     CXios::initServerSide();      
+   }
+
+   void cxios_init_client(const char * client_id , int len_client_id, MPI_Fint* f_local_comm, MPI_Fint* f_return_comm )
+   {
+      std::string str; 
+      MPI_Comm local_comm ;
+      MPI_Comm return_comm ;
+      
+      if (!cstr2string(client_id, len_client_id, str)) return;
+      
+      int initialized ;
+      MPI_Initialized(&initialized) ;
+      if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm) ;
+      else local_comm=MPI_COMM_NULL ;
+      CXios::initClientSide(str,local_comm,return_comm);
+      *f_return_comm=MPI_Comm_c2f(return_comm) ;
+   }
+
+   void cxios_context_initialize(const char * context_id , int len_context_id, MPI_Fint* f_comm)
+   {
+     std::string str; 
+     MPI_Comm comm ;
+     
+     if (!cstr2string(context_id, len_context_id, str)) return;
+     comm=MPI_Comm_f2c(*f_comm) ;
+     ym::CClient::registerContext(context_id,comm) ;
+   }
+ 
+    void cxios_context_close_definition()
+   {
+     boost::shared_ptr<CContext> context =
+            CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+     context->closeDefinition() ;
+   }  
+
+   void cxios_context_finalize()
+   {
+     boost::shared_ptr<CContext> context =
+            CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+     context->finalize() ;
+   }
+   
+   void cxios_finalize()
+   {
+     CXios::clientFinalize() ;
+   }
+
+   
+   void cxios_dtreatment_start()
+   {
+      using namespace xmlioserver::tree;
+      using namespace xmlioserver;
+      try
+      {
+        MPI_Comm comm_client_server=comm::CMPIManager::GetCommClientServer() ;
+        MPI_Comm comm_server=comm::CMPIManager::GetCommServer() ;
+        
+         boost::shared_ptr<CContext> context =
+            CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+                
+         StdOStringStream oss;
+         oss << StdString("def_client_next.")
+             << CMPIManager::GetCommRank(CMPIManager::GetCommClient());
+         CTreeManager::PrintTreeToFile(oss.str());
+         oss.str("");
+         boost::shared_ptr<CDataTreatment> dt(new CDataTreatment (context));
+         context->setDataTreatment(dt);
+
+         oss << StdString("def_client_end.")
+             << CMPIManager::GetCommRank(CMPIManager::GetCommClient());
+         CTreeManager::PrintTreeToFile(oss.str());
+
+         if ( !comm::CMPIManager::IsConnected() )
+         {
+            MPI_Request request = 0;
+            StdOStringStream ostrs;
+
+            CTreeManager::ToBinary(ostrs);
+            CLinearBuffer lbuffer(ostrs.str().size()+CBuffer::getDataHeaderSize());
+            lbuffer.appendString(ostrs.str());
+            CMPIManager::SendLinearBuffer(comm_client_server, 0, lbuffer, request);
+            CMPIManager::Wait(request);  // Pas encore en mode RPC
+               
+               
+            CXIOSManager::RunClient(false, CMPIManager::GetCommClient());
+            CClient::CreateClient(CMPIManager::GetCommClientServer());
+         }
+         else
+         {
+            dt->createDataOutput<CNc4DataOutput>(CMPIManager::GetCommClient());
+         }
+      }
+      catch (CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+   
+   void cxios_dtreatment_end(void)
+   {
+      try
+      {
+         boost::shared_ptr<xmlioserver::tree::CContext> context =
+         xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
+            (CObjectFactory::GetCurrentContextId());
+         boost::shared_ptr<xmlioserver::data::CDataTreatment> dtreat = context->getDataTreatment();
+         dtreat->finalize();
+         
+//         CMPIManager::Finalize();
+      }
+      catch (CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+
+   // ---------------------- Finalize du serveur -------------------------
+
+   void cxios_finalize_ioserver(void)
+   {
+      try
+      {
+         CMPIManager::Finalize();
+      }
+      catch (CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+    }
+
+   // ---------------------- Initialisation du serveur -------------------------
+
+   void cxios_init_ioserver(MPIComm * f_comm_client, MPIComm * f_comm_parent)
+   {
+      try
+      {
+         MPI_Comm comm_client_server, comm_server,comm_client,comm_parent;
+         xmlioserver::CTreeManager::ParseFile("iodef.xml");
+         CTreeManager::SetCurrentContextId(StdString("xios"));
+         CMPIManager::InitialiseClient(NULL, NULL);
+         comm_parent=MPI_Comm_f2c(*f_comm_parent) ;
+         CMPIManager::DispatchClient(false, comm_client, comm_client_server, comm_server,comm_parent);
+         *f_comm_client=MPI_Comm_c2f(comm_client) ;
+      }
+      catch (CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+   
+   // ---------------------- Ecriture des donnÃ©es ------------------------------
+   
+   void cxios_write_data_k81(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      
+//      boost::const_multi_array_ref<double, 1> array_(data_k8,
+//          boost::extents [data_Xsize],
+//          boost::fortran_storage_order());
+      ARRAY(double, 1) data(new CArray<double, 1>(boost::extents [data_Xsize]));
+      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
+      
+//      dtreat->write_data(fieldid_str, data);
+      CField::get(fieldid)->setData(data) ;
+   }
+   
+   void cxios_write_data_k82(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return;
+      
+//      boost::const_multi_array_ref<double, 2> array_(data_k8,
+//          boost::extents [data_Xsize][data_Ysize],
+//          boost::fortran_storage_order());
+      ARRAY(double, 2) data(new CArray<double, 2>(boost::extents [data_Xsize][data_Ysize]));
+      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
+//      dtreat->write_data(fieldid_str, data);
+      CField::get(fieldid)->setData(data) ;
+   }
+   
+   void cxios_write_data_k83(const char * fieldid, int fieldid_size, double * data_k8, int data_Xsize, int data_Ysize, int data_Zsize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      
+//      boost::const_multi_array_ref<double, 3> array_(data_k8,
+//          boost::extents [data_Xsize][data_Ysize][data_Zsize],
+//          boost::fortran_storage_order());
+      ARRAY(double, 3) data(new CArray<double, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
+      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
+//      dtreat->write_data(fieldid_str, data);
+      CField::get(fieldid)->setData(data) ;
+
+   }
+   
+   void cxios_write_data_k41(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      
+//      boost::const_multi_array_ref<float, 1> array_(data_k4,
+//          boost::extents [data_Xsize],
+//          boost::fortran_storage_order());
+//      ARRAY(float, 1) data(new CArray<float, 1>(boost::extents [data_Xsize]));
+//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
+//      dtreat->write_data(fieldid_str, data);
+      ARRAY(double, 1) data(new CArray<double, 1>(boost::extents [data_Xsize]));
+      double* ptr_data=data->data() ; 
+      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+      CField::get(fieldid)->setData(data) ;
+   }
+   
+   void cxios_write_data_k42(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      
+//      boost::const_multi_array_ref<float, 2> array_(data_k4,
+//          boost::extents [data_Xsize][data_Ysize],
+//          boost::fortran_storage_order());
+//      ARRAY(float, 2) data(new CArray<float, 2>(boost::extents [data_Xsize][data_Ysize]));
+//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
+//      dtreat->write_data(fieldid_str, data);
+      ARRAY(double, 2) data(new CArray<double, 2>(boost::extents [data_Xsize][data_Ysize]));
+      double* ptr_data=data->data() ; 
+      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+      CField::get(fieldid)->setData(data) ;
+   }
+   
+   void cxios_write_data_k43(const char * fieldid, int fieldid_size, float * data_k4, int data_Xsize, int data_Ysize, int data_Zsize)
+   {
+      std::string fieldid_str;
+      boost::shared_ptr<CContext> context =
+      CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      if (!cstr2string(fieldid, fieldid_size, fieldid_str)) return; 
+      
+//      boost::const_multi_array_ref<float, 3> array_(data_k4,
+//          boost::extents [data_Xsize][data_Ysize][data_Zsize],
+//          boost::fortran_storage_order());
+//      ARRAY(float, 3) data(new CArray<float, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
+//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
+//      dtreat->write_data(fieldid_str, data);
+      ARRAY(double, 3) data(new CArray<double, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
+      double* ptr_data=data->data() ; 
+      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+      CField::get(fieldid)->setData(data) ;
+    } 
+
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icdate.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icdate.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icdate.cpp	(revision 306)
@@ -0,0 +1,52 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "calendar_type.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   void cxios_set_timestep(double ts_year, double ts_month,  double ts_day,
+                          double ts_hour, double ts_minute, double ts_second)
+   {
+      try
+      {
+         date::CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second};
+         boost::shared_ptr<xmlioserver::tree::CContext> context =
+         xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
+            (CObjectFactory::GetCurrentContextId());
+         
+            context->timestep.setValue(dur.toString());
+            context->sendAttributToServer("timestep") ;
+      }
+      catch (xmlioserver::CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+   
+   void cxios_update_calendar(int step)
+   {
+      boost::shared_ptr<xmlioserver::tree::CContext> context =
+            xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CContext>
+            (CObjectFactory::GetCurrentContextId());
+      context->updateCalendar(step) ;
+      context->sendUpdateCalendar(step) ;
+      
+   }
+
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icdomain.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icdomain.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icdomain.cpp	(revision 306)
@@ -0,0 +1,492 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xmlioserver::tree::CDomain      * XDomainPtr;
+   typedef xmlioserver::tree::CDomainGroup * XDomainGroupPtr;
+
+   // ------------------------- Attributs des axes -----------------------------
+   
+   void cxios_set_domain_name(XDomainPtr domain_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      domain_hdl->name.setValue(name_str);
+      domain_hdl->sendAttributToServer(domain_hdl->name) ; 
+   }
+   
+   void cxios_set_domain_standard_name(XDomainPtr domain_hdl, const char * standard_name, int standard_name_size)
+   {
+      std::string standard_name_str; 
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      domain_hdl->standard_name.setValue(standard_name_str);
+      domain_hdl->sendAttributToServer(domain_hdl->standard_name) ; 
+   }
+   
+   void cxios_set_domain_long_name(XDomainPtr domain_hdl, const char * long_name, int long_name_size)
+   {
+      std::string long_name_str; 
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      domain_hdl->long_name.setValue(long_name_str);
+      domain_hdl->sendAttributToServer(domain_hdl->long_name) ; 
+   }
+   
+   void cxios_set_domain_domain_group_ref(XDomainPtr domain_hdl, const char * domain_group_ref, int domain_group_ref_size)
+   {
+      std::string domain_group_ref_str; 
+      if (!cstr2string(domain_group_ref, domain_group_ref_size, domain_group_ref_str)) return;
+
+      domain_hdl->domain_group_ref.setValue(domain_group_ref_str);
+      domain_hdl->sendAttributToServer(domain_hdl->domain_group_ref) ; 
+   }
+   
+   void cxios_set_domain_ni_glo(XDomainPtr domain_hdl, int ni_glo)
+   {
+      domain_hdl->ni_glo.setValue(ni_glo);
+      domain_hdl->sendAttributToServer(domain_hdl->ni_glo) ; 
+   }
+   
+   void cxios_set_domain_nj_glo(XDomainPtr domain_hdl, int nj_glo)
+   {
+      domain_hdl->nj_glo.setValue(nj_glo);
+      domain_hdl->sendAttributToServer(domain_hdl->nj_glo) ; 
+   }
+   
+   void cxios_set_domain_ibegin(XDomainPtr domain_hdl, int ibegin)
+   {
+      domain_hdl->ibegin.setValue(ibegin);
+      domain_hdl->sendAttributToServer(domain_hdl->ibegin) ; 
+   }
+   
+   void cxios_set_domain_iend(XDomainPtr domain_hdl, int iend)
+   {
+      domain_hdl->iend.setValue(iend);
+      domain_hdl->sendAttributToServer(domain_hdl->iend) ; 
+   }
+   
+   void cxios_set_domain_ni(XDomainPtr domain_hdl, int ni)
+   {
+      domain_hdl->ni.setValue(ni);
+      domain_hdl->sendAttributToServer(domain_hdl->ni) ; 
+   }
+   
+   void cxios_set_domain_jbegin(XDomainPtr domain_hdl, int jbegin)
+   {
+      domain_hdl->jbegin.setValue(jbegin);
+      domain_hdl->sendAttributToServer(domain_hdl->jbegin) ; 
+   }
+   
+   void cxios_set_domain_jend(XDomainPtr domain_hdl, int jend)
+   {
+      domain_hdl->jend.setValue(jend);
+      domain_hdl->sendAttributToServer(domain_hdl->jend) ; 
+   }
+   
+   void cxios_set_domain_nj(XDomainPtr domain_hdl, int nj)
+   {
+      domain_hdl->nj.setValue(nj);
+      domain_hdl->sendAttributToServer(domain_hdl->nj) ; 
+   }
+   
+   void cxios_set_domain_mask(XDomainPtr domain_hdl, bool * mask, int mask_extent1, int mask_extent2)
+   {
+      ARRAY(bool, 2) mask_val(new CArray<bool, 2>(boost::extents [mask_extent1][mask_extent2]));
+      std::copy(mask, &(mask[mask_val->num_elements()]), mask_val->data());
+
+      domain_hdl->mask.setValue(mask_val);
+      domain_hdl->sendAttributToServer(domain_hdl->mask) ; 
+   }
+   
+   void cxios_set_domain_data_dim(XDomainPtr domain_hdl, int data_dim)
+   {
+      domain_hdl->data_dim.setValue(data_dim);
+      domain_hdl->sendAttributToServer(domain_hdl->data_dim) ; 
+   }
+   
+   void cxios_set_domain_data_ni(XDomainPtr domain_hdl, int data_ni)
+   {
+      domain_hdl->data_ni.setValue(data_ni);
+      domain_hdl->sendAttributToServer(domain_hdl->data_ni) ; 
+   }
+   
+   void cxios_set_domain_data_nj(XDomainPtr domain_hdl, int data_nj)
+   {
+      domain_hdl->data_nj.setValue(data_nj);
+      domain_hdl->sendAttributToServer(domain_hdl->data_nj) ; 
+   }
+   
+   void cxios_set_domain_data_ibegin(XDomainPtr domain_hdl, int data_ibegin)
+   {
+      domain_hdl->data_ibegin.setValue(data_ibegin);
+      domain_hdl->sendAttributToServer(domain_hdl->data_ibegin) ; 
+   }
+   
+   void cxios_set_domain_data_jbegin(XDomainPtr domain_hdl, int data_jbegin)
+   {
+      domain_hdl->data_jbegin.setValue(data_jbegin);
+      domain_hdl->sendAttributToServer(domain_hdl->data_jbegin) ; 
+   }
+   
+   void cxios_set_domain_zoom_ni(XDomainPtr domain_hdl, int zoom_ni)
+   {
+      domain_hdl->zoom_ni.setValue(zoom_ni);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_ni) ; 
+   }
+   
+   void cxios_set_domain_zoom_nj(XDomainPtr domain_hdl, int zoom_nj)
+   {
+      domain_hdl->zoom_nj.setValue(zoom_nj);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_nj) ; 
+   }
+   
+   void cxios_set_domain_zoom_ibegin(XDomainPtr domain_hdl, int zoom_ibegin)
+   {
+      domain_hdl->zoom_ibegin.setValue(zoom_ibegin);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_ibegin) ; 
+   }
+    
+   void cxios_set_domain_zoom_jbegin(XDomainPtr domain_hdl, int zoom_jbegin)
+   {
+      domain_hdl->zoom_jbegin.setValue(zoom_jbegin);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_jbegin) ; 
+   }
+   
+   void cxios_set_domain_zoom_ni_loc(XDomainPtr domain_hdl, int zoom_ni_loc)
+   {
+      domain_hdl->zoom_ni_loc.setValue(zoom_ni_loc);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_ni_loc) ; 
+   }
+   
+   void cxios_set_domain_zoom_nj_loc(XDomainPtr domain_hdl, int zoom_nj_loc)
+   {
+      domain_hdl->zoom_nj_loc.setValue(zoom_nj_loc);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_nj_loc) ; 
+   }
+   
+   void cxios_set_domain_zoom_ibegin_loc(XDomainPtr domain_hdl, int zoom_ibegin_loc)
+   {
+      domain_hdl->zoom_ibegin_loc.setValue(zoom_ibegin_loc);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_ibegin_loc) ; 
+   }
+   
+   void cxios_set_domain_zoom_jbegin_loc(XDomainPtr domain_hdl, int zoom_jbegin_loc)
+   {
+      domain_hdl->zoom_jbegin_loc.setValue(zoom_jbegin_loc);
+      domain_hdl->sendAttributToServer(domain_hdl->zoom_jbegin_loc) ; 
+   }
+   
+   void cxios_set_domain_data_n_index(XDomainPtr domain_hdl, int data_n_index)
+   {
+      domain_hdl->data_n_index.setValue(data_n_index);
+      domain_hdl->sendAttributToServer(domain_hdl->data_n_index) ; 
+   }
+   
+   void cxios_set_domain_data_i_index(XDomainPtr domain_hdl, int * data_i_index, int data_i_index_extent1)
+   {
+      ARRAY(int, 1) data_i_index_val(new CArray<int, 1>(boost::extents [data_i_index_extent1]));
+      std::copy(data_i_index, &(data_i_index[data_i_index_val->num_elements()]), data_i_index_val->data());
+
+      domain_hdl->data_i_index.setValue(data_i_index_val);
+      domain_hdl->sendAttributToServer(domain_hdl->data_i_index) ; 
+   }
+   
+   void cxios_set_domain_data_j_index(XDomainPtr domain_hdl, int * data_j_index, int data_j_index_extent1)
+   {
+      ARRAY(int, 1) data_j_index_val(new CArray<int, 1>(boost::extents [data_j_index_extent1]));
+      std::copy(data_j_index, &(data_j_index[data_j_index_val->num_elements()]), data_j_index_val->data());
+
+      domain_hdl->data_j_index.setValue(data_j_index_val);
+      domain_hdl->sendAttributToServer(domain_hdl->data_j_index) ; 
+   }
+    
+   void cxios_set_domain_lonvalue(XDomainPtr domain_hdl, double * lonvalue, int lonvalue_extent1)
+   {
+      ARRAY(double, 1) lonvalue_val(new CArray<double, 1>(boost::extents [lonvalue_extent1]));
+      std::copy(lonvalue, &(lonvalue[lonvalue_val->num_elements()]), lonvalue_val->data());
+
+      domain_hdl->lonvalue.setValue(lonvalue_val);
+      domain_hdl->sendAttributToServer(domain_hdl->lonvalue) ; 
+   }
+   
+   void cxios_set_domain_latvalue(XDomainPtr domain_hdl, double * latvalue, int latvalue_extent1)
+   {
+      ARRAY(double, 1) latvalue_val(new CArray<double, 1>(boost::extents [latvalue_extent1]));
+      std::copy(latvalue, &(latvalue[latvalue_val->num_elements()]), latvalue_val->data());
+
+      domain_hdl->latvalue.setValue(latvalue_val);
+      domain_hdl->sendAttributToServer(domain_hdl->latvalue) ; 
+   }   
+   
+   // -------------------- Attributs des groupes de domaine ------------------------
+   
+   
+   void cxios_set_domaingroup_name(XDomainGroupPtr domaingroup_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      domaingroup_hdl->name.setValue(name_str);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->name) ; 
+      
+   }
+   
+   void cxios_set_domaingroup_standard_name(XDomainGroupPtr domaingroup_hdl, const char * standard_name, int standard_name_size)
+   {
+      std::string standard_name_str; 
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      domaingroup_hdl->standard_name.setValue(standard_name_str);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->standard_name) ;
+   }
+   
+   void cxios_set_domaingroup_long_name(XDomainGroupPtr domaingroup_hdl, const char * long_name, int long_name_size)
+   {
+      std::string long_name_str; 
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      domaingroup_hdl->long_name.setValue(long_name_str);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->long_name) ;
+   }
+   
+   void cxios_set_domaingroup_domain_group_ref(XDomainGroupPtr domaingroup_hdl, const char * domain_group_ref, int domain_group_ref_size)
+   {
+      std::string domain_group_ref_str; 
+      if (!cstr2string(domain_group_ref, domain_group_ref_size, domain_group_ref_str)) return;
+
+      domaingroup_hdl->domain_group_ref.setValue(domain_group_ref_str);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->domain_group_ref) ;
+   }
+   
+   void cxios_set_domaingroup_ni_glo(XDomainGroupPtr domaingroup_hdl, int ni_glo)
+   {
+      domaingroup_hdl->ni_glo.setValue(ni_glo);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->ni_glo) ;
+   }
+   
+   void cxios_set_domaingroup_nj_glo(XDomainGroupPtr domaingroup_hdl, int nj_glo)
+   {
+      domaingroup_hdl->nj_glo.setValue(nj_glo);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->nj_glo) ;
+   }
+   
+   void cxios_set_domaingroup_ibegin(XDomainGroupPtr domaingroup_hdl, int ibegin)
+   {
+      domaingroup_hdl->ibegin.setValue(ibegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->ibegin) ;
+   }
+   
+   void cxios_set_domaingroup_iend(XDomainGroupPtr domaingroup_hdl, int iend)
+   {
+      domaingroup_hdl->iend.setValue(iend);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->iend) ;
+   }
+   
+   void cxios_set_domaingroup_ni(XDomainGroupPtr domaingroup_hdl, int ni)
+   {
+      domaingroup_hdl->ni.setValue(ni);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->ni) ;
+   }
+   
+   void cxios_set_domaingroup_jbegin(XDomainGroupPtr domaingroup_hdl, int jbegin)
+   {
+      domaingroup_hdl->jbegin.setValue(jbegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->jbegin) ;
+   }
+   
+   void cxios_set_domaingroup_jend(XDomainGroupPtr domaingroup_hdl, int jend)
+   {
+      domaingroup_hdl->jend.setValue(jend);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->jend) ;
+   }
+   
+   void cxios_set_domaingroup_nj(XDomainGroupPtr domaingroup_hdl, int nj)
+   {
+      domaingroup_hdl->nj.setValue(nj);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->nj) ;
+   }
+   
+   void cxios_set_domaingroup_mask(XDomainGroupPtr domaingroup_hdl, bool * mask, int mask_extent1, int mask_extent2)
+   {
+      ARRAY(bool, 2) mask_val(new CArray<bool, 2>(boost::extents [mask_extent1][mask_extent2]));
+      std::copy(mask, &(mask[mask_val->num_elements()]), mask_val->data());
+
+      domaingroup_hdl->mask.setValue(mask_val);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->mask) ;
+   }
+   
+   void cxios_set_domaingroup_data_dim(XDomainGroupPtr domaingroup_hdl, int data_dim)
+   {
+      domaingroup_hdl->data_dim.setValue(data_dim);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_dim) ;
+   }
+   
+   void cxios_set_domaingroup_data_ni(XDomainGroupPtr domaingroup_hdl, int data_ni)
+   {
+      domaingroup_hdl->data_ni.setValue(data_ni);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_ni) ;
+   }
+   
+   void cxios_set_domaingroup_data_nj(XDomainGroupPtr domaingroup_hdl, int data_nj)
+   {
+      domaingroup_hdl->data_nj.setValue(data_nj);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_nj) ;
+   }
+   
+   void cxios_set_domaingroup_data_ibegin(XDomainGroupPtr domaingroup_hdl, int data_ibegin)
+   {
+      domaingroup_hdl->data_ibegin.setValue(data_ibegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_ibegin) ;
+   }
+   
+   void cxios_set_domaingroup_data_jbegin(XDomainGroupPtr domaingroup_hdl, int data_jbegin)
+   {
+      domaingroup_hdl->data_jbegin.setValue(data_jbegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_jbegin) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_ni(XDomainGroupPtr domaingroup_hdl, int zoom_ni)
+   {
+      domaingroup_hdl->zoom_ni.setValue(zoom_ni);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_ni) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_nj(XDomainGroupPtr domaingroup_hdl, int zoom_nj)
+   {
+      domaingroup_hdl->zoom_nj.setValue(zoom_nj);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_nj) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_ibegin(XDomainGroupPtr domaingroup_hdl, int zoom_ibegin)
+   {
+      domaingroup_hdl->zoom_ibegin.setValue(zoom_ibegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_ibegin) ;
+   }
+    
+   void cxios_set_domaingroup_zoom_jbegin(XDomainGroupPtr domaingroup_hdl, int zoom_jbegin)
+   {
+      domaingroup_hdl->zoom_jbegin.setValue(zoom_jbegin);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_jbegin) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_ni_loc(XDomainGroupPtr domaingroup_hdl, int zoom_ni_loc)
+   {
+      domaingroup_hdl->zoom_ni_loc.setValue(zoom_ni_loc);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_ni_loc) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_nj_loc(XDomainGroupPtr domaingroup_hdl, int zoom_nj_loc)
+   {
+      domaingroup_hdl->zoom_nj_loc.setValue(zoom_nj_loc);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_nj_loc) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_ibegin_loc(XDomainGroupPtr domaingroup_hdl, int zoom_ibegin_loc)
+   {
+      domaingroup_hdl->zoom_ibegin_loc.setValue(zoom_ibegin_loc);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_ibegin_loc) ;
+   }
+   
+   void cxios_set_domaingroup_zoom_jbegin_loc(XDomainGroupPtr domaingroup_hdl, int zoom_jbegin_loc)
+   {
+      domaingroup_hdl->zoom_jbegin_loc.setValue(zoom_jbegin_loc);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->zoom_jbegin_loc) ;
+   }
+   
+   void cxios_set_domaingroup_data_n_index(XDomainGroupPtr domaingroup_hdl, int data_n_index)
+   {
+      domaingroup_hdl->data_n_index.setValue(data_n_index);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_n_index) ;
+   }
+   
+   void cxios_set_domaingroup_data_i_index(XDomainGroupPtr domaingroup_hdl, int * data_i_index, int data_i_index_extent1)
+   {
+      ARRAY(int, 1) data_i_index_val(new CArray<int, 1>(boost::extents [data_i_index_extent1]));
+      std::copy(data_i_index, &(data_i_index[data_i_index_val->num_elements()]), data_i_index_val->data());
+
+      domaingroup_hdl->data_i_index.setValue(data_i_index_val);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_i_index) ;
+   }
+   
+   void cxios_set_domaingroup_data_j_index(XDomainGroupPtr domaingroup_hdl, int * data_j_index, int data_j_index_extent1)
+   {
+      ARRAY(int, 1) data_j_index_val(new CArray<int, 1>(boost::extents [data_j_index_extent1]));
+      std::copy(data_j_index, &(data_j_index[data_j_index_val->num_elements()]), data_j_index_val->data());
+
+      domaingroup_hdl->data_j_index.setValue(data_j_index_val);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_j_index) ;
+   }
+    
+   void cxios_set_domaingroup_lonvalue(XDomainGroupPtr domaingroup_hdl, double * lonvalue, int lonvalue_extent1)
+   {
+      ARRAY(double, 1) lonvalue_val(new CArray<double, 1>(boost::extents [lonvalue_extent1]));
+      std::copy(lonvalue, &(lonvalue[lonvalue_val->num_elements()]), lonvalue_val->data());
+
+      domaingroup_hdl->lonvalue.setValue(lonvalue_val);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->lonvalue) ;
+   }
+   
+   void cxios_set_domaingroup_latvalue(XDomainGroupPtr domaingroup_hdl, double * latvalue, int latvalue_extent1)
+   {
+      ARRAY(double, 1) latvalue_val(new CArray<double, 1>(boost::extents [latvalue_extent1]));
+      std::copy(latvalue, &(latvalue[latvalue_val->num_elements()]), latvalue_val->data());
+
+      domaingroup_hdl->latvalue.setValue(latvalue_val);
+      domaingroup_hdl->sendAttributToServer(domaingroup_hdl->latvalue) ;
+   }  
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   
+   void cxios_domain_handle_create (XDomainPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomain>(id).get();
+   }
+   
+   void cxios_domaingroup_handle_create (XDomainGroupPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomainGroup>(id).get();
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_domain_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CDomain>(id);
+   }
+
+   void cxios_domaingroup_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CDomainGroup>(id);
+   }
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icfield.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icfield.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icfield.cpp	(revision 306)
@@ -0,0 +1,295 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+   
+   typedef xmlioserver::tree::CField      * XFieldPtr;
+   typedef xmlioserver::tree::CFieldGroup * XFieldGroupPtr;
+
+   // ------------------------- Attributs des champs ---------------------------
+   
+   void cxios_set_field_name(XFieldPtr field_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      field_hdl->name.setValue(name_str);
+      field_hdl->sendAttributToServer(field_hdl->name) ; 
+   }
+   
+   void cxios_set_field_standard_name(XFieldPtr field_hdl, const char * standard_name, int standard_name_size)
+   {
+      std::string standard_name_str; 
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      field_hdl->standard_name.setValue(standard_name_str);
+      field_hdl->sendAttributToServer(field_hdl->standard_name) ; 
+   }
+   
+   void cxios_set_field_long_name(XFieldPtr field_hdl, const char * long_name, int long_name_size)
+   {
+      std::string long_name_str; 
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      field_hdl->long_name.setValue(long_name_str);
+      field_hdl->sendAttributToServer(field_hdl->long_name) ;
+   }
+   
+   void cxios_set_field_unit(XFieldPtr field_hdl, const char * unit, int unit_size)
+   {
+      std::string unit_str; 
+      if (!cstr2string(unit, unit_size, unit_str)) return;
+
+      field_hdl->unit.setValue(unit_str);
+      field_hdl->sendAttributToServer(field_hdl->unit) ;
+
+   }
+   
+   void cxios_set_field_operation(XFieldPtr field_hdl, const char * operation, int operation_size) 
+   {
+      std::string operation_str; 
+      if (!cstr2string(operation, operation_size, operation_str)) return;
+
+      field_hdl->operation.setValue(operation_str);
+      field_hdl->sendAttributToServer(field_hdl->operation) ;
+   }
+   
+   void cxios_set_field_freq_op(XFieldPtr field_hdl, const char * freq_op, int freq_op_size)
+   {
+      std::string freq_op_str; 
+      if (!cstr2string(freq_op, freq_op_size, freq_op_str)) return;
+
+      field_hdl->freq_op.setValue(freq_op_str);
+      field_hdl->sendAttributToServer(field_hdl->freq_op) ;
+   }
+   
+   void cxios_set_field_level(XFieldPtr field_hdl, int level)
+   {
+      field_hdl->level.setValue(level);
+      field_hdl->sendAttributToServer(field_hdl->level) ;
+   }
+   
+   void cxios_set_field_prec(XFieldPtr field_hdl, int prec)
+   {
+      field_hdl->prec.setValue(prec);
+      field_hdl->sendAttributToServer(field_hdl->prec) ;
+   }
+   
+   void cxios_set_field_enabled(XFieldPtr field_hdl, bool enabled)
+   {
+      field_hdl->enabled.setValue(enabled);
+      field_hdl->sendAttributToServer(field_hdl->enabled) ;
+   }
+   
+   void cxios_set_field_domain_ref(XFieldPtr field_hdl,  const char * domain_ref, int domain_ref_size)
+   {
+      std::string domain_ref_str; 
+      if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
+
+      field_hdl->domain_ref.setValue(domain_ref_str);
+      field_hdl->sendAttributToServer(field_hdl->domain_ref) ;
+   }
+   
+   void cxios_set_field_axis_ref(XFieldPtr field_hdl,  const char * axis_ref,  int axis_ref_size)
+   {
+      std::string axis_ref_str; 
+      if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
+
+      field_hdl->axis_ref.setValue(axis_ref_str);
+      field_hdl->sendAttributToServer(field_hdl->axis_ref) ;
+   }
+   
+   void cxios_set_field_grid_ref(XFieldPtr field_hdl,  const char * grid_ref, int grid_ref_size)
+   {
+      std::string grid_ref_str; 
+      if (!cstr2string(grid_ref, grid_ref_size, grid_ref_str)) return;
+
+      field_hdl->grid_ref.setValue(grid_ref_str);
+      field_hdl->sendAttributToServer(field_hdl->grid_ref) ;
+   }
+   
+   void cxios_set_field_field_ref(XFieldPtr field_hdl,  const char * field_ref,  int field_ref_size)
+   {
+      std::string field_ref_str; 
+      if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return;
+
+      field_hdl->field_ref.setValue(field_ref_str);
+      field_hdl->sendAttributToServer(field_hdl->field_ref) ;
+   }
+   
+   void cxios_set_field_default_value(XFieldPtr field_hdl, double default_value)
+   {
+      field_hdl->default_value.setValue(default_value);
+      field_hdl->sendAttributToServer(field_hdl->default_value) ;
+   }  
+   
+   // -------------------- Attributs des groupes de champs ---------------------
+  
+   void cxios_set_fieldgroup_name(XFieldGroupPtr fieldgroup_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      fieldgroup_hdl->name.setValue(name_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->name);
+   }
+   
+   void cxios_set_fieldgroup_standard_name(XFieldGroupPtr fieldgroup_hdl, const char * standard_name, int standard_name_size)
+   {
+      std::string standard_name_str; 
+      if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
+
+      fieldgroup_hdl->standard_name.setValue(standard_name_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->standard_name);
+   }
+   
+   void cxios_set_fieldgroup_long_name(XFieldGroupPtr fieldgroup_hdl, const char * long_name, int long_name_size)
+   {
+      std::string long_name_str; 
+      if (!cstr2string(long_name, long_name_size, long_name_str)) return;
+
+      fieldgroup_hdl->long_name.setValue(long_name_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->long_name);
+   }
+   
+   void cxios_set_fieldgroup_unit(XFieldGroupPtr fieldgroup_hdl, const char * unit, int unit_size)
+   {
+      std::string unit_str; 
+      if (!cstr2string(unit, unit_size, unit_str)) return;
+
+      fieldgroup_hdl->unit.setValue(unit_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->unit);
+   }
+   
+   void cxios_set_fieldgroup_operation(XFieldGroupPtr fieldgroup_hdl, const char * operation, int operation_size) 
+   {
+      std::string operation_str; 
+      if (!cstr2string(operation, operation_size, operation_str)) return;
+
+      fieldgroup_hdl->operation.setValue(operation_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->operation);
+   }
+   
+   void cxios_set_fieldgroup_freq_op(XFieldGroupPtr fieldgroup_hdl, const char * freq_op, int freq_op_size)
+   {
+      std::string freq_op_str; 
+      if (!cstr2string(freq_op, freq_op_size, freq_op_str)) return;
+
+      fieldgroup_hdl->freq_op.setValue(freq_op_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->freq_op);
+   }
+   
+   void cxios_set_fieldgroup_level(XFieldGroupPtr fieldgroup_hdl, int level)
+   {
+      fieldgroup_hdl->level.setValue(level);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->level);
+   }
+   
+   void cxios_set_fieldgroup_prec(XFieldGroupPtr fieldgroup_hdl, int prec)
+   {
+      fieldgroup_hdl->prec.setValue(prec);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->prec);
+   }
+   
+   void cxios_set_fieldgroup_enabled(XFieldGroupPtr fieldgroup_hdl, bool enabled)
+   {
+      fieldgroup_hdl->enabled.setValue(enabled);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->enabled);
+   }
+   
+   void cxios_set_fieldgroup_domain_ref(XFieldGroupPtr fieldgroup_hdl,  const char * domain_ref, int domain_ref_size)
+   {
+      std::string domain_ref_str; 
+      if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
+
+      fieldgroup_hdl->domain_ref.setValue(domain_ref_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->domain_ref);
+   }
+   
+   void cxios_set_fieldgroup_axis_ref(XFieldGroupPtr fieldgroup_hdl,  const char * axis_ref,  int axis_ref_size)
+   {
+      std::string axis_ref_str; 
+      if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
+
+      fieldgroup_hdl->axis_ref.setValue(axis_ref_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->axis_ref);
+   }
+   
+   void cxios_set_fieldgroup_grid_ref(XFieldGroupPtr fieldgroup_hdl,  const char * grid_ref, int grid_ref_size)
+   {
+      std::string grid_ref_str; 
+      if (!cstr2string(grid_ref, grid_ref_size, grid_ref_str)) return;
+
+      fieldgroup_hdl->grid_ref.setValue(grid_ref_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->grid_ref);
+   }
+   
+   void cxios_set_fieldgroup_field_ref(XFieldGroupPtr fieldgroup_hdl,  const char * field_ref,  int field_ref_size)
+   {
+      std::string field_ref_str; 
+      if (!cstr2string(field_ref, field_ref_size, field_ref_str)) return;
+
+      fieldgroup_hdl->field_ref.setValue(field_ref_str);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->field_ref);
+   }
+   
+   void cxios_set_fieldgroup_default_value(XFieldGroupPtr fieldgroup_hdl, double default_value)
+   {
+      fieldgroup_hdl->default_value.setValue(default_value);
+      fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->default_value);
+   }  
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   
+   void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CField>(id).get();
+   }
+   
+   void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFieldGroup>(id).get();
+   }
+
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CField>(id);
+   }
+
+   void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CFieldGroup>(id);
+   }
+   
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icfile.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icfile.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icfile.cpp	(revision 306)
@@ -0,0 +1,178 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+   
+   typedef xmlioserver::tree::CFile      * XFilePtr;
+   typedef xmlioserver::tree::CFileGroup * XFileGroupPtr;
+
+   // ------------------------- Attributs des axes -----------------------------
+   
+   void cxios_set_file_name(XFilePtr file_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      file_hdl->name.setValue(name_str);
+      file_hdl->sendAttributToServer(file_hdl->name) ;
+   }
+   
+   void cxios_set_file_description(XFilePtr file_hdl, const char * description, int description_size)
+   {
+      std::string description_str; 
+      if (!cstr2string(description, description_size, description_str)) return;
+
+      file_hdl->description.setValue(description_str);
+      file_hdl->sendAttributToServer(file_hdl->description) ;
+   } 
+   
+   void cxios_set_file_name_suffix(XFilePtr file_hdl, const char * name_suffix, int name_suffix_size)
+   {
+      std::string name_suffix_str; 
+      if (!cstr2string(name_suffix, name_suffix_size, name_suffix_str)) return;
+
+      file_hdl->name_suffix.setValue(name_suffix_str);
+      file_hdl->sendAttributToServer(file_hdl->name_suffix) ;
+   } 
+   
+   void cxios_set_file_output_freq(XFilePtr file_hdl, const char * output_freq, int output_freq_size)
+   {
+      std::string output_freq_str; 
+      if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return;
+
+      file_hdl->output_freq.setValue(output_freq_str);
+      file_hdl->sendAttributToServer(file_hdl->output_freq) ;
+   }
+   
+   void cxios_set_file_output_level(XFilePtr file_hdl, int output_level)
+   {
+      file_hdl->output_level.setValue(output_level);
+      file_hdl->sendAttributToServer(file_hdl->output_level) ;
+   }
+   
+   void cxios_set_file_enabled(XFilePtr file_hdl, bool enabled)
+   {
+      file_hdl->enabled.setValue(enabled);
+      file_hdl->sendAttributToServer(file_hdl->enabled) ;
+   }
+   
+   void cxios_set_file_type(XFilePtr file_hdl, const char * type, int type_size)
+   {
+      std::string type_str; 
+      if (!cstr2string(type, type_size, type_str)) return;
+
+      file_hdl->type.setValue(type_str);
+      file_hdl->sendAttributToServer(file_hdl->type) ;
+   }
+   
+   // -------------------- Attributs des groupes d'axes ------------------------
+   
+   void cxios_set_filegroup_name(XFileGroupPtr filegroup_hdl, const char * name, int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      filegroup_hdl->name.setValue(name_str);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->name) ;
+   }
+   
+   void cxios_set_filegroup_description(XFileGroupPtr filegroup_hdl, const char * description, int description_size)
+   {
+      std::string description_str; 
+      if (!cstr2string(description, description_size, description_str)) return;
+
+      filegroup_hdl->description.setValue(description_str);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->description) ;
+   } 
+   
+   void cxios_set_filegroup_name_suffix(XFileGroupPtr filegroup_hdl, const char * name_suffix, int name_suffix_size)
+   {
+      std::string name_suffix_str; 
+      if (!cstr2string(name_suffix, name_suffix_size, name_suffix_str)) return;
+
+      filegroup_hdl->name_suffix.setValue(name_suffix_str);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->name_suffix) ;
+   } 
+   
+   void cxios_set_filegroup_output_freq(XFileGroupPtr filegroup_hdl, const char * output_freq, int output_freq_size)
+   {
+      std::string output_freq_str; 
+      if (!cstr2string(output_freq, output_freq_size, output_freq_str)) return;
+
+      filegroup_hdl->output_freq.setValue(output_freq_str);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->output_freq) ;
+   }
+   
+   void cxios_set_filegroup_output_level(XFileGroupPtr filegroup_hdl, int output_level)
+   {
+      filegroup_hdl->output_level.setValue(output_level);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->output_level) ;
+   }
+   
+   void cxios_set_filegroup_enabled(XFileGroupPtr filegroup_hdl, bool enabled)
+   {
+      filegroup_hdl->enabled.setValue(enabled);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->enabled) ;
+   }
+   
+   void cxios_set_filegroup_type(XFileGroupPtr filegroup_hdl, const char * type, int type_size)
+   {
+      std::string type_str; 
+      if (!cstr2string(type, type_size, type_str)) return;
+
+      filegroup_hdl->type.setValue(type_str);
+      filegroup_hdl->sendAttributToServer(filegroup_hdl->type) ;
+   }
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   
+   void cxios_file_handle_create (XFilePtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFile>(id).get();
+   }
+   
+   void cxios_filegroup_handle_create (XFileGroupPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFileGroup>(id).get();
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_file_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CFile>(id);
+   }
+
+   void cxios_filegroup_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CFileGroup>(id);
+   }
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icgrid.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icgrid.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icgrid.cpp	(revision 306)
@@ -0,0 +1,136 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+   
+   typedef xmlioserver::tree::CGrid      * XGridPtr;
+   typedef xmlioserver::tree::CGridGroup * XGridGroupPtr;
+
+   // ------------------------- Attributs des axes -----------------------------
+   
+   void cxios_set_grid_name(XGridPtr grid_hdl, const char * name,  int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      grid_hdl->name.setValue(name_str);
+      grid_hdl->sendAttributToServer(name_str) ;
+   }
+   
+   void cxios_set_grid_description(XGridPtr grid_hdl, const char * description,  int description_size)
+   {
+      std::string description_str; 
+      if (!cstr2string(description, description_size, description_str)) return;
+
+      grid_hdl->description.setValue(description_str);
+      grid_hdl->sendAttributToServer(description_str) ;
+   }
+   
+   void cxios_set_grid_domain_ref(XGridPtr grid_hdl, const char * domain_ref,  int domain_ref_size)
+   {
+      std::string domain_ref_str; 
+      if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
+
+      grid_hdl->domain_ref.setValue(domain_ref_str);
+      grid_hdl->sendAttributToServer(domain_ref_str) ;
+   }
+   
+   void cxios_set_grid_axis_ref(XGridPtr grid_hdl, const char * axis_ref,  int axis_ref_size)
+   {
+      std::string axis_ref_str; 
+      if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
+
+     grid_hdl->axis_ref.setValue(axis_ref_str);
+     grid_hdl->sendAttributToServer(axis_ref_str) ;
+   }
+   
+   // -------------------- Attributs des groupes de grilles --------------------
+   
+   void cxios_set_gridgroup_name(XGridGroupPtr gridgroup_hdl, const char * name,  int name_size)
+   {
+      std::string name_str; 
+      if (!cstr2string(name, name_size, name_str)) return;
+
+      gridgroup_hdl->name.setValue(name_str);
+      gridgroup_hdl->sendAttributToServer(gridgroup_hdl->name) ;
+   }
+   
+   void cxios_set_gridgroup_description(XGridGroupPtr gridgroup_hdl, const char * description,  int description_size)
+   {
+      std::string description_str; 
+      if (!cstr2string(description, description_size, description_str)) return;
+
+      gridgroup_hdl->description.setValue(description_str);
+      gridgroup_hdl->sendAttributToServer(gridgroup_hdl->description) ;
+   }
+   
+   void cxios_set_gridgroup_domain_ref(XGridGroupPtr gridgroup_hdl, const char * domain_ref,  int domain_ref_size)
+   {
+      std::string domain_ref_str; 
+      if (!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
+
+      gridgroup_hdl->domain_ref.setValue(domain_ref_str);
+      gridgroup_hdl->sendAttributToServer(gridgroup_hdl->domain_ref) ;
+   }
+   
+   void cxios_set_gridgroup_axis_ref(XGridGroupPtr gridgroup_hdl, const char * axis_ref,  int axis_ref_size)
+   {
+      std::string axis_ref_str; 
+      if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
+
+      gridgroup_hdl->axis_ref.setValue(axis_ref_str);
+      gridgroup_hdl->sendAttributToServer(gridgroup_hdl->axis_ref) ;
+   }
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+  
+   void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGrid>(id).get();
+   }
+   
+   void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id; 
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CGridGroup>(id).get();
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+
+   void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CGrid>(id);
+   }
+
+   void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CGridGroup>(id);
+   }
+} // extern "C"
Index: /XIOS/trunk/src/fortran/icontext.F90
===================================================================
--- /XIOS/trunk/src/fortran/icontext.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/icontext.F90	(revision 306)
@@ -0,0 +1,224 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE ICONTEXT
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE CONTEXT_INTERFACE
+   USE IDATE
+
+   TYPE XContextHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XContextHandle
+    
+   TYPE txios(context)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(context)
+      
+   !----------------------------------------------------------------------------
+   INTERFACE set_context_attributes
+      MODULE PROCEDURE set_context_attributes_id,set_context_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+   
+   SUBROUTINE xios(set_context_attr)( context_id, calendar_type, start_date, output_dir)
+      IMPLICIT NONE
+      CHARACTER(len = *)            , INTENT(IN) :: context_id
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir
+         
+      CALL xios(set_context_attr_)( context_id, calendar_type, start_date, output_dir)
+   END SUBROUTINE xios(set_context_attr)
+
+
+   SUBROUTINE xios(set_context_attr_)( context_id, calendar_type_, start_date_, output_dir_)
+      IMPLICIT NONE
+      CHARACTER(len = *)            , INTENT(IN) :: context_id
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir_
+      TYPE(txios(context))                      :: context_hdl
+         
+      CALL xios(get_context_handle)(context_id,context_hdl)
+      CALL xios(set_context_attr_hdl_)( context_hdl, calendar_type_, start_date_, output_dir_)
+   END SUBROUTINE xios(set_context_attr_)
+
+
+   SUBROUTINE xios(set_context_attr_hdl)( context_hdl, calendar_type, start_date, output_dir)
+      IMPLICIT NONE
+      TYPE(txios(context))          , INTENT(IN) :: context_hdl
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir   
+        
+      CALL  xios(set_context_attr_hdl_)( context_hdl, calendar_type, start_date, output_dir)  
+
+   END SUBROUTINE xios(set_context_attr_hdl)
+
+   SUBROUTINE xios(set_context_attr_hdl_)( context_hdl, calendar_type_, start_date_, output_dir_)
+      IMPLICIT NONE
+      TYPE(txios(context))          , INTENT(IN) :: context_hdl
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir_   
+         
+      IF (PRESENT(calendar_type_)) THEN
+         CALL cxios_set_context_calendar_type(context_hdl%daddr, calendar_type_, len(calendar_type_))
+      END IF
+      IF (PRESENT(start_date_))    THEN
+         CALL cxios_set_context_start_date(context_hdl%daddr, start_date_, len(start_date_))
+      END IF
+      IF (PRESENT(output_dir_))    THEN
+         CALL cxios_set_context_output_dir(context_hdl%daddr, output_dir_, len(output_dir_))
+      END IF
+   END SUBROUTINE xios(set_context_attr_hdl_)
+
+
+
+   SUBROUTINE xios(get_context_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)  , INTENT(IN)  :: idt      
+      TYPE(txios(context)), INTENT(OUT):: ret
+
+      CALL cxios_context_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE xios(get_context_handle)
+   
+   SUBROUTINE xios(set_current_context)(context, withswap)
+      IMPLICIT NONE
+
+      TYPE(txios(context))          , INTENT(IN) :: context
+      LOGICAL             , OPTIONAL, INTENT(IN) :: withswap
+      LOGICAL (kind = 1)                       :: wswap
+
+      IF (PRESENT(withswap)) THEN
+         wswap = withswap
+      ELSE
+         wswap = .FALSE.
+      END IF
+      CALL cxios_context_set_current(context%daddr, wswap)
+
+   END SUBROUTINE xios(set_current_context)
+   
+   
+!   SUBROUTINE context_create(context_hdl, context_id, calendar_type, init_date)
+!      TYPE(XContextHandle)          , INTENT(OUT) :: context_hdl
+!      CHARACTER(len = *)            , INTENT(IN)  :: context_id
+!      INTEGER                       , INTENT(IN)  :: calendar_type
+!      TYPE(XDate)         , OPTIONAL, INTENT(IN)  :: init_date
+!     IF (PRESENT(init_date)) THEN
+!         CALL cxios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+!                                  init_date%year, init_date%month, init_date%day, &
+!                                  init_date%hour, init_date%minute, init_date%second)
+!      ELSE
+!         CALL cxios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+!                                 0, 1, 1, 0, 0, 0)
+!      END IF
+!   END SUBROUTINE context_create
+
+   LOGICAL FUNCTION xios(is_valid_context)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_context_valid_id(val, idt, len(idt));
+      xios(is_valid_context) = val
+
+   END FUNCTION  xios(is_valid_context)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+!!!!!!!! ancienne interface
+
+   SUBROUTINE set_context_attributes_id( context_id, calendar_type_, start_date_, output_dir_)
+      IMPLICIT NONE
+      TYPE(XContextHandle)                       :: context_hdl
+      CHARACTER(len = *)            , INTENT(IN) :: context_id
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir_
+         
+      CALL context_handle_create(context_hdl, context_id)
+      CALL set_context_attributes_hdl( context_hdl, calendar_type_, start_date_, output_dir_)
+   END SUBROUTINE set_context_attributes_id
+
+   SUBROUTINE set_context_attributes_hdl( context_hdl, calendar_type_, start_date_, output_dir_)
+      IMPLICIT NONE
+      TYPE(XContextHandle)          , INTENT(IN) :: context_hdl
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: calendar_type_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: start_date_
+      CHARACTER(len = *)  , OPTIONAL, INTENT(IN) :: output_dir_   
+         
+      IF (PRESENT(calendar_type_)) THEN
+         CALL cxios_set_context_calendar_type(context_hdl%daddr, calendar_type_, len(calendar_type_))
+      END IF
+      IF (PRESENT(start_date_))    THEN
+         CALL cxios_set_context_start_date(context_hdl%daddr, start_date_, len(start_date_))
+      END IF
+      IF (PRESENT(output_dir_))    THEN
+         CALL cxios_set_context_output_dir(context_hdl%daddr, output_dir_, len(output_dir_))
+      END IF
+   END SUBROUTINE set_context_attributes_hdl
+
+   SUBROUTINE context_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XContextHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)  , INTENT(IN) :: idt      
+      CALL cxios_context_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE context_handle_create
+   
+   SUBROUTINE context_set_current(context, withswap)
+      TYPE(XContextHandle)          , INTENT(IN) :: context
+      LOGICAL             , OPTIONAL, INTENT(IN) :: withswap
+      LOGICAL (kind = 1)                       :: wswap
+      IF (PRESENT(withswap)) THEN
+         wswap = withswap
+      ELSE
+         wswap = .FALSE.
+      END IF
+      CALL cxios_context_set_current(context%daddr, wswap)
+   END SUBROUTINE context_set_current
+   
+   SUBROUTINE context_create(context_hdl, context_id, calendar_type, init_date)
+      TYPE(XContextHandle)          , INTENT(OUT) :: context_hdl
+      CHARACTER(len = *)            , INTENT(IN)  :: context_id
+      INTEGER                       , INTENT(IN)  :: calendar_type
+      TYPE(XDate)         , OPTIONAL, INTENT(IN)  :: init_date
+      IF (PRESENT(init_date)) THEN
+         CALL cxios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                  init_date%year, init_date%month, init_date%day, &
+                                  init_date%hour, init_date%minute, init_date%second)
+      ELSE
+         CALL cxios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                 0, 1, 1, 0, 0, 0)
+      END IF
+   END SUBROUTINE context_create
+
+   LOGICAL FUNCTION context_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_context_valid_id(val, idt, len(idt));
+      context_valid_id = val
+   END FUNCTION  context_valid_id
+
+
+   
+END MODULE ICONTEXT
Index: /XIOS/trunk/src/fortran/icutil.hpp
===================================================================
--- /XIOS/trunk/src/fortran/icutil.hpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icutil.hpp	(revision 306)
@@ -0,0 +1,31 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+
+#ifndef __ICUTIL_HPP__
+#define __ICUTIL_HPP__
+
+#include <string>
+
+// ///////////////////////// DÃ©finitions/DÃ©clarations /////////////////////// //
+
+inline bool cstr2string(const char * cstr, int cstr_size, std::string & str)
+{
+  std::string valtemp;
+  std::size_t d, f = 0;
+  if (cstr_size != -1) 
+  { 
+     valtemp.append (cstr, cstr_size);
+     d = valtemp.find_first_not_of(' ');
+     f = valtemp.find_last_not_of (' ');
+     str = valtemp.substr(d, f-d+1); 
+     return (true);
+  }
+  else
+  {
+     return (false);
+  }  
+}
+
+#endif // __ICUTIL_HPP__
Index: /XIOS/trunk/src/fortran/icxml_tree.cpp
===================================================================
--- /XIOS/trunk/src/fortran/icxml_tree.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/icxml_tree.cpp	(revision 306)
@@ -0,0 +1,297 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "icutil.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xmlioserver::tree::CContext * XContextPtr;
+
+   typedef xmlioserver::tree::CGrid      * XGridPtr;
+   typedef xmlioserver::tree::CGridGroup * XGridGroupPtr;
+
+   typedef xmlioserver::tree::CFile      * XFilePtr;
+   typedef xmlioserver::tree::CFileGroup * XFileGroupPtr;
+
+   typedef xmlioserver::tree::CField      * XFieldPtr;
+   typedef xmlioserver::tree::CFieldGroup * XFieldGroupPtr;
+
+   typedef xmlioserver::tree::CDomain      * XDomainPtr;
+   typedef xmlioserver::tree::CDomainGroup * XDomainGroupPtr;
+
+   typedef xmlioserver::tree::CAxis      * XAxisPtr;
+   typedef xmlioserver::tree::CAxisGroup * XAxisGroupPtr;
+   
+   // ----------------------- Ajout d'enfant Ã  un parent -----------------------
+   
+   void cxios_xml_tree_add_field
+      (XFieldGroupPtr  parent_, XFieldPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChild(child_id_str).get() ;
+         parent_->sendCreateChild(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChild().get() ;
+         parent_->sendCreateChild() ;
+      }
+  }
+   
+   void cxios_xml_tree_add_grid
+      (XGridGroupPtr   parent_, XGridPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChild(child_id_str).get() ;
+         parent_->sendCreateChild(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChild().get() ;
+         parent_->sendCreateChild() ;
+      }
+   }
+   
+   void cxios_xml_tree_add_file
+      (XFileGroupPtr parent_, XFilePtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChild(child_id_str).get() ;
+         parent_->sendCreateChild(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChild().get() ;
+         parent_->sendCreateChild() ;
+      }
+   }
+   
+   void cxios_xml_tree_add_axis
+      (XAxisGroupPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChild(child_id_str).get() ;
+         parent_->sendCreateChild(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChild().get() ;
+         parent_->sendCreateChild() ;
+      }
+   }
+   
+   void cxios_xml_tree_add_domain
+      (XDomainGroupPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChild(child_id_str).get() ;
+         parent_->sendCreateChild(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChild().get() ;
+         parent_->sendCreateChild() ;
+      }
+   }
+   
+   void cxios_xml_tree_add_fieldtofile
+      (XFilePtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+ 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addField(child_id_str).get();
+         parent_->sendAddField(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addField().get();
+         parent_->sendAddField() ;
+      }
+   }
+
+   // ----------------------- Ajout de groupe Ã  un parent ----------------------
+
+   void cxios_xml_tree_add_fieldgroup
+      (XFieldGroupPtr  parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+     std::string child_id_str; 
+
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChildGroup(child_id_str).get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChildGroup().get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+   }
+
+   void cxios_xml_tree_add_gridgroup
+      (XGridGroupPtr   parent_, XGridGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+ 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChildGroup(child_id_str).get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChildGroup().get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+   }
+
+   void cxios_xml_tree_add_filegroup
+      (XFileGroupPtr parent_, XFileGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChildGroup(child_id_str).get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChildGroup().get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+   }
+
+   void cxios_xml_tree_add_axisgroup
+      (XAxisGroupPtr parent_, XAxisGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChildGroup(child_id_str).get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChildGroup().get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+   }
+
+   void cxios_xml_tree_add_domaingroup
+      (XDomainGroupPtr parent_, XDomainGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->createChildGroup(child_id_str).get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->createChildGroup().get() ;
+         parent_->sendCreateChildGroup(child_id_str) ;
+      }
+   }
+
+   void cxios_xml_tree_add_fieldgrouptofile
+      (XFilePtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+ 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addFieldGroup(child_id_str).get();
+         parent_->sendAddFieldGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addFieldGroup().get();
+         parent_->sendAddFieldGroup() ;
+      }
+   }
+   
+   
+   // ----------------------- Affichage de l'arborescence ----------------------
+   
+   void cxios_xml_tree_show   (const char * filename, int filename_size) 
+   {
+      std::string filename_str;
+      try
+      {
+         if (cstr2string(filename, filename_size, filename_str))
+            xmlioserver::CTreeManager::PrintTreeToFile(filename_str);
+         else
+            xmlioserver::CTreeManager::PrintTreeToStream(std::clog);
+      }
+      catch (xmlioserver::CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+     
+   
+   // ----------------------- Parsing de document xml --------------------------
+   
+   void cxios_xml_parse_file  (const char * filename  , int filename_size)
+   {
+      std::string filename_str; 
+      if (!cstr2string(filename, filename_size, filename_str)) return;
+
+      try
+      {
+         xmlioserver::CTreeManager::ParseFile(filename_str);
+      }
+      catch (xmlioserver::CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+   
+   void cxios_xml_parse_string(const char * xmlcontent, int xmlcontent_size)
+   {
+      std::string xmlcontent_str; 
+      if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return;
+
+      try
+      {
+         xmlioserver::CTreeManager::ParseString(xmlcontent_str);
+      }
+      catch (xmlioserver::CException & exc)
+      {
+         std::cerr << exc.getMessage() << std::endl;
+         exit (EXIT_FAILURE);
+      }
+   }
+   
+
+
+} // extern "C"
Index: /XIOS/trunk/src/fortran/idata.F90
===================================================================
--- /XIOS/trunk/src/fortran/idata.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/idata.F90	(revision 306)
@@ -0,0 +1,300 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IDATA
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE ICONTEXT
+   
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE  cxios_init_server() BIND(C)
+      END SUBROUTINE cxios_init_server
+
+     SUBROUTINE cxios_init_client(client_id, len_client_id, f_local_comm, f_return_comm) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: client_id
+         INTEGER  (kind = C_INT)     , VALUE        :: len_client_id
+         INTEGER  (kind = C_INT)                    :: f_local_comm
+         INTEGER  (kind = C_INT)                    :: f_return_comm
+      END SUBROUTINE cxios_init_client
+      
+      SUBROUTINE  cxios_context_initialize(context_id,len_context_id,f_comm) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: context_id
+         INTEGER  (kind = C_INT)     , VALUE        :: len_context_id
+         INTEGER  (kind = C_INT)                    :: f_comm
+      END SUBROUTINE cxios_context_initialize
+
+       SUBROUTINE  cxios_context_close_definition() BIND(C)
+         USE ISO_C_BINDING
+      END SUBROUTINE cxios_context_close_definition
+     
+
+       SUBROUTINE  cxios_context_finalize() BIND(C)
+         USE ISO_C_BINDING
+      END SUBROUTINE cxios_context_finalize
+     
+      SUBROUTINE  cxios_init_ioserver(comm_client,comm_parent) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INT) :: comm_client
+         INTEGER  (kind = C_INT) :: comm_parent
+      END SUBROUTINE cxios_init_ioserver
+
+      SUBROUTINE  cxios_finalize_ioserver BIND(C)
+      END SUBROUTINE cxios_finalize_ioserver
+ 
+      SUBROUTINE  cxios_finalize BIND(C)
+      END SUBROUTINE cxios_finalize
+
+      SUBROUTINE cxios_dtreatment_start() BIND(C)
+         USE ISO_C_BINDING
+      END SUBROUTINE cxios_dtreatment_start
+
+      SUBROUTINE cxios_dtreatment_end() BIND(C)
+         ! Sans argument
+      END SUBROUTINE cxios_dtreatment_end
+
+      SUBROUTINE cxios_write_data_k81(fieldid, fieldid_size, data_k8, data_Xsize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_DOUBLE), DIMENSION(*) :: data_k8
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize
+      END SUBROUTINE cxios_write_data_k81
+      
+      SUBROUTINE cxios_write_data_k82(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_DOUBLE), DIMENSION(*) :: data_k8
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize
+      END SUBROUTINE cxios_write_data_k82
+      
+      SUBROUTINE cxios_write_data_k83(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_DOUBLE), DIMENSION(*) :: data_k8
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize, data_Zsize
+      END SUBROUTINE cxios_write_data_k83
+      
+      SUBROUTINE cxios_write_data_k41(fieldid, fieldid_size, data_k4, data_Xsize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_FLOAT) , DIMENSION(*) :: data_k4
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize
+      END SUBROUTINE cxios_write_data_k41
+      
+      SUBROUTINE cxios_write_data_k42(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_FLOAT) , DIMENSION(*) :: data_k4
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize
+      END SUBROUTINE cxios_write_data_k42
+      
+      SUBROUTINE cxios_write_data_k43(fieldid, fieldid_size, data_k4, data_Xsize, data_Ysize, data_Zsize) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: fieldid
+         REAL     (kind = C_FLOAT) , DIMENSION(*) :: data_k4
+         INTEGER  (kind = C_INT)   , VALUE        :: fieldid_size
+         INTEGER  (kind = C_INT)   , VALUE        :: data_Xsize, data_Ysize, data_Zsize
+      END SUBROUTINE cxios_write_data_k43
+      
+   END INTERFACE
+   
+   INTERFACE write_data
+      MODULE PROCEDURE write_data_k81,write_data_k82,write_data_k83,write_data_k41,write_data_k42,write_data_k43
+   END INTERFACE
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE  xios(init_server)()
+   IMPLICIT NONE
+     CALL cxios_init_server()
+   END SUBROUTINE xios(init_server)
+   
+   SUBROUTINE  xios(initialize)(client_id, local_comm, return_comm)
+   IMPLICIT NONE
+   INCLUDE 'mpif.h'
+   CHARACTER(LEN=*),INTENT(IN) :: client_id
+   INTEGER,INTENT(IN),OPTIONAL         :: local_comm  
+   INTEGER,INTENT(OUT),OPTIONAL        :: return_comm
+   INTEGER :: f_local_comm
+   INTEGER :: f_return_comm
+   
+      IF (PRESENT(local_comm)) THEN
+        f_local_comm=local_comm 
+      ELSE
+        f_local_comm = MPI_COMM_NULL 
+      ENDIF
+      
+      CALL cxios_init_client(client_id,LEN(client_id),f_local_comm,f_return_comm)
+ 
+      IF (PRESENT(return_comm)) return_comm=f_return_comm
+
+   END SUBROUTINE  xios(initialize)
+
+
+   SUBROUTINE  xios(context_initialize)(context_id,comm)
+   IMPLICIT NONE
+   CHARACTER(LEN=*),INTENT(IN)  :: context_id
+   INTEGER, INTENT(IN)          :: comm
+      
+      CALL cxios_context_initialize(context_id,LEN(context_id),comm)
+ 
+    END SUBROUTINE  xios(context_initialize)
+    
+    
+   SUBROUTINE  xios(finalize)
+   IMPLICIT NONE
+
+      CALL cxios_finalize
+
+    END SUBROUTINE  xios(finalize)
+
+   
+   SUBROUTINE xios(close_context_definition)()
+   IMPLICIT NONE
+      CALL cxios_context_close_definition()
+   END SUBROUTINE xios(close_context_definition)
+
+   
+   SUBROUTINE xios(context_finalize)()
+   IMPLICIT NONE
+      CALL cxios_context_finalize()
+   END SUBROUTINE xios(context_finalize)
+   
+
+   
+   SUBROUTINE xios(send_field_r8_1d)(fieldid, data1d_k8)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data1d_k8(:)
+      CALL cxios_write_data_k81(fieldid, len(fieldid), data1d_k8, size(data1d_k8, 1))
+   END SUBROUTINE xios(send_field_r8_1d)
+   
+   SUBROUTINE  xios(send_field_r8_2d)(fieldid, data2d_k8)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data2d_k8(:,:)
+      CALL cxios_write_data_k82(fieldid, len(fieldid), data2d_k8, size(data2d_k8, 1), size(data2d_k8, 2))
+   END SUBROUTINE  xios(send_field_r8_2d)
+   
+   SUBROUTINE  xios(send_field_r8_3d)(fieldid, data3d_k8)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data3d_k8(:,:,:)
+      CALL cxios_write_data_k83(fieldid, len(fieldid), data3d_k8, size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3))
+   END SUBROUTINE  xios(send_field_r8_3d)
+   
+   SUBROUTINE xios(send_field_r4_1d)(fieldid, data1d_k4)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data1d_k4(:)
+      CALL cxios_write_data_k41(fieldid, len(fieldid), data1d_k4, size(data1d_k4, 1))
+   END SUBROUTINE xios(send_field_r4_1d)
+   
+   SUBROUTINE xios(send_field_r4_2d)(fieldid, data2d_k4)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data2d_k4(:,:)
+      CALL cxios_write_data_k42(fieldid, len(fieldid), data2d_k4, size(data2d_k4, 1), size(data2d_k4, 2))
+   END SUBROUTINE xios(send_field_r4_2d)
+   
+   SUBROUTINE xios(send_field_r4_3d)(fieldid, data3d_k4)
+   IMPLICIT NONE
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data3d_k4(:,:,:)
+      CALL cxios_write_data_k43(fieldid, len(fieldid), data3d_k4, size(data3d_k4, 1), size(data3d_k4, 2), size(data3d_k4, 3))
+   END SUBROUTINE xios(send_field_r4_3d)
+   
+
+
+
+!!!!!!!!!!!!!! anciennes Interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE  init_ioserver(local_comm,return_comm )
+   IMPLICIT NONE
+   INCLUDE 'mpif.h'
+      INTEGER, INTENT(OUT),OPTIONAL :: return_comm
+      INTEGER, INTENT(IN),OPTIONAL :: local_comm
+
+      INTEGER  :: comm_client
+      INTEGER  :: comm_parent
+      
+      IF (PRESENT(local_comm)) THEN
+        comm_parent=local_comm
+      ELSE
+        comm_parent=MPI_COMM_WORLD
+      ENDIF
+      
+      CALL cxios_init_ioserver(comm_client,comm_parent)
+      IF (PRESENT(return_comm)) return_comm=comm_client ;
+
+    END SUBROUTINE  init_ioserver
+
+   SUBROUTINE  finalize_ioserver
+   IMPLICIT NONE
+
+      CALL cxios_finalize_ioserver
+
+    END SUBROUTINE  finalize_ioserver
+
+   
+   SUBROUTINE dtreatment_start(context_hdl, filetype)
+      TYPE(XContextHandle), INTENT(IN)           :: context_hdl
+      INTEGER             , INTENT(IN), OPTIONAL :: filetype 
+      INTEGER                                    :: filetype_
+      IF (PRESENT(filetype)) THEN
+         filetype_ = filetype
+      ELSE
+         filetype_ = NETCDF4
+      END IF
+      CALL context_set_current(context_hdl)
+      CALL cxios_dtreatment_start()
+   END SUBROUTINE dtreatment_start
+   
+   SUBROUTINE dtreatment_end(context_hdl)
+      TYPE(XContextHandle), INTENT(IN), OPTIONAL :: context_hdl
+      CALL cxios_dtreatment_end()
+   END SUBROUTINE dtreatment_end
+   
+   SUBROUTINE write_data_k81(fieldid, data1d_k8)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data1d_k8(:)
+      CALL cxios_write_data_k81(fieldid, len(fieldid), data1d_k8, size(data1d_k8, 1))
+   END SUBROUTINE write_data_k81
+   
+   SUBROUTINE write_data_k82(fieldid, data2d_k8)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data2d_k8(:,:)
+      CALL cxios_write_data_k82(fieldid, len(fieldid), data2d_k8, size(data2d_k8, 1), size(data2d_k8, 2))
+   END SUBROUTINE write_data_k82
+   
+   SUBROUTINE write_data_k83(fieldid, data3d_k8)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 8), DIMENSION(*), INTENT(IN) :: data3d_k8(:,:,:)
+      CALL cxios_write_data_k83(fieldid, len(fieldid), data3d_k8, size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3))
+   END SUBROUTINE write_data_k83
+   
+   SUBROUTINE write_data_k41(fieldid, data1d_k4)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data1d_k4(:)
+      CALL cxios_write_data_k41(fieldid, len(fieldid), data1d_k4, size(data1d_k4, 1))
+   END SUBROUTINE write_data_k41
+   
+   SUBROUTINE write_data_k42(fieldid, data2d_k4)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data2d_k4(:,:)
+      CALL cxios_write_data_k42(fieldid, len(fieldid), data2d_k4, size(data2d_k4, 1), size(data2d_k4, 2))
+   END SUBROUTINE write_data_k42
+   
+   SUBROUTINE write_data_k43(fieldid, data3d_k4)
+      CHARACTER(len = *)               , INTENT(IN) :: fieldid
+      REAL     (kind = 4), DIMENSION(*), INTENT(IN) :: data3d_k4(:,:,:)
+      CALL cxios_write_data_k43(fieldid, len(fieldid), data3d_k4, size(data3d_k4, 1), size(data3d_k4, 2), size(data3d_k4, 3))
+   END SUBROUTINE write_data_k43
+   
+END MODULE IDATA
Index: /XIOS/trunk/src/fortran/idate.F90
===================================================================
--- /XIOS/trunk/src/fortran/idate.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/idate.F90	(revision 306)
@@ -0,0 +1,84 @@
+#include "xios_fortran_prefix.hpp"
+MODULE IDATE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   ! enum XCalendarType
+   INTEGER(kind = C_INT), PARAMETER :: D360 = 0 , ALLLEAP = 1 , NOLEAP = 2 , JULIAN = 3 , GREGORIAN = 4
+
+   TYPE XDate
+      INTEGER :: year, month, day, hour, minute, second
+   END TYPE XDate
+
+   TYPE XDuration
+      REAL(kind = 8) :: year, month, day, hour, minute, second
+   END TYPE XDuration
+
+   TYPE txios(date)
+      INTEGER :: year, month, day, hour, minute, second
+   END TYPE txios(date)
+
+   TYPE txios(time)
+      REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0
+   END TYPE txios(time)   
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+   
+      SUBROUTINE cxios_set_timestep(ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second) BIND(C)
+         IMPORT C_DOUBLE
+         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month , ts_day   , &
+                                          ts_hour, ts_minute, ts_second
+      END SUBROUTINE cxios_set_timestep
+
+      SUBROUTINE cxios_update_calendar(step) BIND(C)
+         IMPORT C_INT
+         INTEGER (kind = C_INT), VALUE :: step
+      END SUBROUTINE cxios_update_calendar
+      
+   END INTERFACE
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+   SUBROUTINE xios(set_timestep)(timestep)
+      IMPLICIT NONE
+      TYPE(txios(time)), INTENT(IN):: timestep
+
+      CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, &
+                             timestep%hour, timestep%minute, timestep%second)
+
+   END SUBROUTINE xios(set_timestep)
+
+
+   
+   SUBROUTINE xios(update_calendar)(step)
+     IMPLICIT NONE
+     INTEGER, INTENT(IN):: step
+      
+      IF (step < 0) THEN
+         PRINT *, "L'argument 'step' ne peut Ãªtre nÃ©gatif"
+         STOP
+      END IF
+      CALL cxios_update_calendar(step)
+      
+   END SUBROUTINE xios(update_calendar)
+
+
+!!!!!!!!!!!! anciennes interfaces !!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   
+   SUBROUTINE set_timestep(timestep)
+      TYPE(XDuration), INTENT(IN):: timestep
+      CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, &
+                             timestep%hour, timestep%minute, timestep%second)
+   END SUBROUTINE set_timestep
+   
+   SUBROUTINE update_calendar(step)
+      INTEGER, INTENT(IN):: step
+      IF (step < 0) THEN
+         PRINT *, "L'argument 'step' ne peut Ãªtre nÃ©gatif"
+         STOP
+      END IF
+      CALL cxios_update_calendar(step)
+   END SUBROUTINE update_calendar
+   
+END MODULE IDATE
Index: /XIOS/trunk/src/fortran/idomain.F90
===================================================================
--- /XIOS/trunk/src/fortran/idomain.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/idomain.F90	(revision 306)
@@ -0,0 +1,982 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IDOMAIN
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE DOMAIN_INTERFACE
+   USE DOMAINGROUP_INTERFACE
+   
+   TYPE XDomainHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XDomainHandle
+   
+   TYPE XDomainGroupHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XDomainGroupHandle
+
+   TYPE txios(domain)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(domain)
+   
+   TYPE txios(domaingroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(domaingroup)
+   
+   !----------------------------------------------------------------------------
+   INTERFACE set_domain_attributes
+      MODULE PROCEDURE set_domain_attributes_id,set_domain_attributes_hdl
+   END INTERFACE  
+   
+   INTERFACE set_domain_group_attributes
+      MODULE PROCEDURE set_domaingroup_attributes_id,set_domaingroup_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+   SUBROUTINE xios(set_domaingroup_attr)                                                                   &
+   ( domaingroup_id, name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,       &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,                     &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,                &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+      IMPLICIT NONE
+      TYPE(txios(domaingroup))                              :: domaingroup_hdl
+      CHARACTER(len = *)                       , INTENT(IN) :: domaingroup_id
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: domain_group_ref
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_glo
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: iend
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jend
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj
+      LOGICAL          , dimension(*), OPTIONAL, INTENT(IN) :: mask(:,:)
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_dim
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_nj
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_n_index
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_i_index(:)
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_j_index(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: lonvalue(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: latvalue(:)
+ 
+      CALL xios(get_domaingroup_handle)(domaingroup_id,domaingroup_hdl)
+      CALL xios(set_domaingroup_attr_hdl_)                                                                 &
+   ( domaingroup_hdl, name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,      &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,                     &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,                &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+
+   END SUBROUTINE xios(set_domaingroup_attr)
+
+   SUBROUTINE xios(set_domaingroup_attr_hdl)                                                               &   
+   ( domaingroup_hdl,name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,       &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,                     &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,                &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+      IMPLICIT NONE
+      TYPE(txios(domaingroup))             , INTENT(IN) :: domaingroup_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask(:,:)
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue(:)   
+
+      CALL xios(set_domaingroup_attr_hdl_)                                                                  &
+   ( domaingroup_hdl,name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,       &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,                   &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,                 &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+
+    END SUBROUTINE xios(set_domaingroup_attr_hdl)
+
+   SUBROUTINE xios(set_domaingroup_attr_hdl_)                                                                       &
+   ( domaingroup_hdl, name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,       &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,                   &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,                 &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(txios(domaingroup))             , INTENT(IN) :: domaingroup_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask_(:,:)
+      LOGICAL(kind = 1), dimension(:,:), ALLOCATABLE          :: mask__! (size(mask_,1),size(mask,2))
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue_(:)
+      
+      IF (PRESENT(name_))             THEN
+         CALL cxios_set_domaingroup_name(domaingroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))    THEN
+         CALL cxios_set_domaingroup_standard_name(domaingroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))        THEN
+         CALL cxios_set_domaingroup_long_name(domaingroup_hdl%daddr, long_name_, len(long_name_))
+       END IF
+      IF (PRESENT(domain_group_ref_)) THEN
+         CALL cxios_set_domaingroup_domain_group_ref(domaingroup_hdl%daddr, domain_group_ref_, len(domain_group_ref_))
+      END IF
+      IF (PRESENT(ni_glo_))           THEN
+         CALL cxios_set_domaingroup_ni_glo(domaingroup_hdl%daddr, ni_glo_)
+      END IF
+      IF (PRESENT(nj_glo_))           THEN
+         CALL cxios_set_domaingroup_nj_glo(domaingroup_hdl%daddr, nj_glo_)
+      END IF
+      IF (PRESENT(ibegin_))           THEN
+         CALL cxios_set_domaingroup_ibegin(domaingroup_hdl%daddr, ibegin_)
+       END IF
+      IF (PRESENT(iend_))             THEN
+         CALL cxios_set_domaingroup_iend(domaingroup_hdl%daddr, iend_)
+      END IF
+      IF (PRESENT(ni_))               THEN
+         CALL cxios_set_domaingroup_ni(domaingroup_hdl%daddr, ni_)
+      END IF
+      IF (PRESENT(jbegin_))           THEN
+         CALL cxios_set_domaingroup_jbegin(domaingroup_hdl%daddr, jbegin_)
+      END IF
+      IF (PRESENT(jend_))             THEN
+         CALL cxios_set_domaingroup_jend(domaingroup_hdl%daddr, jend_)
+      END IF
+      IF (PRESENT(nj_))               THEN
+         CALL cxios_set_domaingroup_nj(domaingroup_hdl%daddr, nj_)
+      END IF
+      IF (PRESENT(mask_))             THEN
+         ALLOCATE(mask__(size(mask_, 1), size(mask_, 2)))
+         mask__(:,:) = mask_(:,:)
+         CALL cxios_set_domaingroup_mask(domaingroup_hdl%daddr, mask__, size(mask_, 1), size(mask_, 2))         
+         DEALLOCATE(mask__)
+      END IF
+      IF (PRESENT(data_dim_))         THEN
+         CALL cxios_set_domaingroup_data_dim(domaingroup_hdl%daddr, data_dim_)
+      END IF
+      IF (PRESENT(data_ni_))          THEN
+         CALL cxios_set_domaingroup_data_ni(domaingroup_hdl%daddr, data_ni_)
+      END IF 
+      IF (PRESENT(data_nj_))          THEN
+         CALL cxios_set_domaingroup_data_nj(domaingroup_hdl%daddr, data_nj_)
+      END IF
+      IF (PRESENT(data_ibegin_))      THEN
+         CALL cxios_set_domaingroup_data_ibegin(domaingroup_hdl%daddr, data_ibegin_)
+      END IF
+      IF (PRESENT(data_jbegin_))      THEN
+         CALL cxios_set_domaingroup_data_jbegin(domaingroup_hdl%daddr, data_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_))          THEN
+         CALL cxios_set_domaingroup_zoom_ni(domaingroup_hdl%daddr, zoom_ni_)
+      END IF
+      IF (PRESENT(zoom_nj_))          THEN
+       CALL cxios_set_domaingroup_zoom_nj(domaingroup_hdl%daddr, zoom_nj_)
+      END IF
+      IF (PRESENT(zoom_ibegin_))      THEN
+         CALL cxios_set_domaingroup_zoom_ibegin(domaingroup_hdl%daddr, zoom_ibegin_)
+      END IF
+      IF (PRESENT(zoom_jbegin_))      THEN
+         CALL cxios_set_domaingroup_zoom_jbegin(domaingroup_hdl%daddr, zoom_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_loc_))      THEN
+         CALL cxios_set_domaingroup_zoom_ni_loc(domaingroup_hdl%daddr, zoom_ni_loc_)
+      END IF   
+      IF (PRESENT(zoom_nj_loc_))      THEN
+         CALL cxios_set_domaingroup_zoom_nj_loc(domaingroup_hdl%daddr, zoom_nj_loc_)
+      END IF
+      IF (PRESENT(zoom_ibegin_loc_))  THEN
+         CALL cxios_set_domaingroup_zoom_ibegin_loc(domaingroup_hdl%daddr, zoom_ibegin_loc_)
+      END IF
+      IF (PRESENT(zoom_jbegin_loc_))  THEN
+         CALL cxios_set_domaingroup_zoom_jbegin_loc(domaingroup_hdl%daddr, zoom_jbegin_loc_)
+      END IF
+      IF (PRESENT(data_n_index_))     THEN
+         CALL cxios_set_domaingroup_data_n_index(domaingroup_hdl%daddr, data_n_index_)
+      END IF
+      IF (PRESENT(data_i_index_))     THEN
+         CALL cxios_set_domaingroup_data_i_index(domaingroup_hdl%daddr, data_i_index_, size(data_i_index_, 1))
+      END IF
+      IF (PRESENT(data_j_index_))     THEN
+         CALL cxios_set_domaingroup_data_j_index(domaingroup_hdl%daddr, data_j_index_, size(data_j_index_, 1))
+      END IF
+      IF (PRESENT(lonvalue_))         THEN
+         CALL cxios_set_domaingroup_lonvalue(domaingroup_hdl%daddr, lonvalue_, size(lonvalue_, 1))
+      END IF
+      IF (PRESENT(latvalue_))         THEN
+         CALL cxios_set_domaingroup_latvalue(domaingroup_hdl%daddr, latvalue_, size(latvalue_, 1))
+      END IF
+
+   END SUBROUTINE xios(set_domaingroup_attr_hdl_)
+   
+   
+   SUBROUTINE xios(set_domain_attr)                                                                &
+   ( domain_id, name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,    &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,             &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,        &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+      IMPLICIT NONE
+      TYPE(txios(domain))                                   :: domain_hdl
+      CHARACTER(len = *)                       , INTENT(IN) :: domain_id
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: domain_group_ref
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_glo
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: iend
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jend
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj
+      LOGICAL          , dimension(*), OPTIONAL, INTENT(IN) :: mask(:,:)
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_dim
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_nj
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_n_index
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_i_index(:)
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_j_index(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: lonvalue(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: latvalue(:)
+ 
+      CALL xios(get_domain_handle)(domain_id,domain_hdl)
+      CALL xios(set_domain_attr_hdl_)                                                                     &
+   ( domain_hdl, name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,    &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,              &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,         &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+
+   END SUBROUTINE xios(set_domain_attr)
+
+
+   SUBROUTINE xios(set_domain_attr_hdl)                                                             &
+   ( domain_hdl,name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,    &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,             &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,        &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+      IMPLICIT NONE
+      TYPE(txios(domain))                       , INTENT(IN) :: domain_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask(:,:)
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue(:)
+      
+      CALL xios(set_domain_attr_hdl_)                                                             &
+   ( domain_hdl,name, standard_name, long_name, domain_group_ref, ni_glo, nj_glo, ibegin, iend,   &
+     ni, jbegin, jend, nj, mask, data_dim, data_ni, data_nj, data_ibegin, data_jbegin,            &
+     zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin, zoom_ni_loc, zoom_nj_loc, zoom_ibegin_loc,       &
+     zoom_jbegin_loc, data_n_index, data_i_index, data_j_index, lonvalue, latvalue)
+     
+   END SUBROUTINE xios(set_domain_attr_hdl)
+       
+   SUBROUTINE xios(set_domain_attr_hdl_)                                                                  &
+   ( domain_hdl,name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,  &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,         &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,       &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(txios(domain))                       , INTENT(IN) :: domain_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask_(:,:)
+      LOGICAL(kind = 1), dimension(:,:), ALLOCATABLE          :: mask__
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue_(:)
+      IF (PRESENT(name_))             THEN
+         CALL cxios_set_domain_name(domain_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))    THEN
+         CALL cxios_set_domain_standard_name(domain_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))        THEN
+         CALL cxios_set_domain_long_name(domain_hdl%daddr, long_name_, len(long_name_))
+       END IF
+      IF (PRESENT(domain_group_ref_)) THEN
+         CALL cxios_set_domain_domain_group_ref(domain_hdl%daddr, domain_group_ref_, len(domain_group_ref_))
+      END IF
+      IF (PRESENT(ni_glo_))           THEN
+         CALL cxios_set_domain_ni_glo(domain_hdl%daddr, ni_glo_)
+      END IF
+      IF (PRESENT(nj_glo_))           THEN
+         CALL cxios_set_domain_nj_glo(domain_hdl%daddr, nj_glo_)
+      END IF
+      IF (PRESENT(ibegin_))           THEN
+         CALL cxios_set_domain_ibegin(domain_hdl%daddr, ibegin_)
+       END IF
+      IF (PRESENT(iend_))             THEN
+         CALL cxios_set_domain_iend(domain_hdl%daddr, iend_)
+      END IF
+      IF (PRESENT(ni_))               THEN
+         CALL cxios_set_domain_ni(domain_hdl%daddr, ni_)
+      END IF
+      IF (PRESENT(jbegin_))           THEN
+         CALL cxios_set_domain_jbegin(domain_hdl%daddr, jbegin_)
+      END IF
+      IF (PRESENT(jend_))             THEN
+         CALL cxios_set_domain_jend(domain_hdl%daddr, jend_)
+      END IF
+      IF (PRESENT(nj_))               THEN
+         CALL cxios_set_domain_nj(domain_hdl%daddr, nj_)
+      END IF
+      IF (PRESENT(mask_))             THEN
+         ALLOCATE(mask__(size(mask_, 1), size(mask_, 2)))
+         mask__(:,:) = mask_(:,:)
+         CALL cxios_set_domain_mask(domain_hdl%daddr, mask__, size(mask_, 1), size(mask_, 2))         
+         DEALLOCATE(mask__)
+      END IF
+      IF (PRESENT(data_dim_))         THEN
+         CALL cxios_set_domain_data_dim(domain_hdl%daddr, data_dim_)
+      END IF
+      IF (PRESENT(data_ni_))          THEN
+         CALL cxios_set_domain_data_ni(domain_hdl%daddr, data_ni_)
+      END IF 
+      IF (PRESENT(data_nj_))          THEN
+         CALL cxios_set_domain_data_nj(domain_hdl%daddr, data_nj_)
+      END IF
+      IF (PRESENT(data_ibegin_))      THEN
+         CALL cxios_set_domain_data_ibegin(domain_hdl%daddr, data_ibegin_)
+      END IF
+      IF (PRESENT(data_jbegin_))      THEN
+         CALL cxios_set_domain_data_jbegin(domain_hdl%daddr, data_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_))          THEN
+         CALL cxios_set_domain_zoom_ni(domain_hdl%daddr, zoom_ni_)
+      END IF
+      IF (PRESENT(zoom_nj_))          THEN
+       CALL cxios_set_domain_zoom_nj(domain_hdl%daddr, zoom_nj_)
+      END IF
+      IF (PRESENT(zoom_ibegin_))      THEN
+         CALL cxios_set_domain_zoom_ibegin(domain_hdl%daddr, zoom_ibegin_)
+      END IF
+      IF (PRESENT(zoom_jbegin_))      THEN
+         CALL cxios_set_domain_zoom_jbegin(domain_hdl%daddr, zoom_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_loc_))      THEN
+         CALL cxios_set_domain_zoom_ni_loc(domain_hdl%daddr, zoom_ni_loc_)
+      END IF   
+      IF (PRESENT(zoom_nj_loc_))      THEN
+         CALL cxios_set_domain_zoom_nj_loc(domain_hdl%daddr, zoom_nj_loc_)
+      END IF
+      IF (PRESENT(zoom_ibegin_loc_))  THEN
+         CALL cxios_set_domain_zoom_ibegin_loc(domain_hdl%daddr, zoom_ibegin_loc_)
+      END IF
+      IF (PRESENT(zoom_jbegin_loc_))  THEN
+         CALL cxios_set_domain_zoom_jbegin_loc(domain_hdl%daddr, zoom_jbegin_loc_)
+      END IF
+      IF (PRESENT(data_n_index_))     THEN
+         CALL cxios_set_domain_data_n_index(domain_hdl%daddr, data_n_index_)
+      END IF
+      IF (PRESENT(data_i_index_))     THEN
+         CALL cxios_set_domain_data_i_index(domain_hdl%daddr, data_i_index_, size(data_i_index_, 1))
+      END IF
+      IF (PRESENT(data_j_index_))     THEN
+         CALL cxios_set_domain_data_j_index(domain_hdl%daddr, data_j_index_, size(data_j_index_, 1))
+      END IF
+      IF (PRESENT(lonvalue_))         THEN
+         CALL cxios_set_domain_lonvalue(domain_hdl%daddr, lonvalue_, size(lonvalue_, 1))
+      END IF
+      IF (PRESENT(latvalue_))         THEN
+         CALL cxios_set_domain_latvalue(domain_hdl%daddr, latvalue_, size(latvalue_, 1))
+      END IF
+
+   END SUBROUTINE xios(set_domain_attr_hdl_)
+
+
+   
+   SUBROUTINE xios(get_domain_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *) , INTENT(IN) :: idt      
+      TYPE(txios(domain)), INTENT(OUT):: ret
+ 
+      CALL cxios_domain_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_domain_handle)
+   
+   SUBROUTINE xios(get_domaingroup_handle)(idt, ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)      , INTENT(IN) :: idt      
+      TYPE(txios(domaingroup)), INTENT(OUT):: ret
+
+      CALL cxios_domaingroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_domaingroup_handle)
+
+   LOGICAL FUNCTION xios(is_valid_domain)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_domain_valid_id(val, idt, len(idt));
+      xios(is_valid_domain) = val
+   END FUNCTION  xios(is_valid_domain)
+
+   LOGICAL FUNCTION xios(is_valid_domaingroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_domaingroup_valid_id(val, idt, len(idt));
+      xios(is_valid_domaingroup) = val
+   END FUNCTION  xios(is_valid_domaingroup)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+!!!!!!!!!!!! Ancienne interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   
+   SUBROUTINE set_domaingroup_attributes_id                                                                        &
+   ( domaingroup_id, name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,       &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,                   &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,                 &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(XDomainGroupHandle)                              :: domaingroup_hdl
+      CHARACTER(len = *)                       , INTENT(IN) :: domaingroup_id
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*), OPTIONAL, INTENT(IN) :: mask_(:,:)
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: latvalue_(:)
+ 
+      CALL domaingroup_handle_create(domaingroup_hdl, domaingroup_id)
+      CALL set_domaingroup_attributes_hdl                                                                          &
+   ( domaingroup_hdl, name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,      &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,                   &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,                 &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+
+   END SUBROUTINE set_domaingroup_attributes_id
+   
+   SUBROUTINE set_domaingroup_attributes_hdl                                                                       &
+   ( domaingroup_hdl,name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,       &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,                   &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,                 &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(XDomainGroupHandle)                   , INTENT(IN) :: domaingroup_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask_(:,:)
+      LOGICAL(kind = 1), dimension(:,:), ALLOCATABLE          :: mask__! (size(mask_,1),size(mask,2))
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue_(:)
+      
+      IF (PRESENT(name_))             THEN
+         CALL cxios_set_domaingroup_name(domaingroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))    THEN
+         CALL cxios_set_domaingroup_standard_name(domaingroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))        THEN
+         CALL cxios_set_domaingroup_long_name(domaingroup_hdl%daddr, long_name_, len(long_name_))
+       END IF
+      IF (PRESENT(domain_group_ref_)) THEN
+         CALL cxios_set_domaingroup_domain_group_ref(domaingroup_hdl%daddr, domain_group_ref_, len(domain_group_ref_))
+      END IF
+      IF (PRESENT(ni_glo_))           THEN
+         CALL cxios_set_domaingroup_ni_glo(domaingroup_hdl%daddr, ni_glo_)
+      END IF
+      IF (PRESENT(nj_glo_))           THEN
+         CALL cxios_set_domaingroup_nj_glo(domaingroup_hdl%daddr, nj_glo_)
+      END IF
+      IF (PRESENT(ibegin_))           THEN
+         CALL cxios_set_domaingroup_ibegin(domaingroup_hdl%daddr, ibegin_)
+       END IF
+      IF (PRESENT(iend_))             THEN
+         CALL cxios_set_domaingroup_iend(domaingroup_hdl%daddr, iend_)
+      END IF
+      IF (PRESENT(ni_))               THEN
+         CALL cxios_set_domaingroup_ni(domaingroup_hdl%daddr, ni_)
+      END IF
+      IF (PRESENT(jbegin_))           THEN
+         CALL cxios_set_domaingroup_jbegin(domaingroup_hdl%daddr, jbegin_)
+      END IF
+      IF (PRESENT(jend_))             THEN
+         CALL cxios_set_domaingroup_jend(domaingroup_hdl%daddr, jend_)
+      END IF
+      IF (PRESENT(nj_))               THEN
+         CALL cxios_set_domaingroup_nj(domaingroup_hdl%daddr, nj_)
+      END IF
+      IF (PRESENT(mask_))             THEN
+         ALLOCATE(mask__(size(mask_, 1), size(mask_, 2)))
+         mask__(:,:) = mask_(:,:)
+         CALL cxios_set_domaingroup_mask(domaingroup_hdl%daddr, mask__, size(mask_, 1), size(mask_, 2))         
+         DEALLOCATE(mask__)
+      END IF
+      IF (PRESENT(data_dim_))         THEN
+         CALL cxios_set_domaingroup_data_dim(domaingroup_hdl%daddr, data_dim_)
+      END IF
+      IF (PRESENT(data_ni_))          THEN
+         CALL cxios_set_domaingroup_data_ni(domaingroup_hdl%daddr, data_ni_)
+      END IF 
+      IF (PRESENT(data_nj_))          THEN
+         CALL cxios_set_domaingroup_data_nj(domaingroup_hdl%daddr, data_nj_)
+      END IF
+      IF (PRESENT(data_ibegin_))      THEN
+         CALL cxios_set_domaingroup_data_ibegin(domaingroup_hdl%daddr, data_ibegin_)
+      END IF
+      IF (PRESENT(data_jbegin_))      THEN
+         CALL cxios_set_domaingroup_data_jbegin(domaingroup_hdl%daddr, data_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_))          THEN
+         CALL cxios_set_domaingroup_zoom_ni(domaingroup_hdl%daddr, zoom_ni_)
+      END IF
+      IF (PRESENT(zoom_nj_))          THEN
+       CALL cxios_set_domaingroup_zoom_nj(domaingroup_hdl%daddr, zoom_nj_)
+      END IF
+      IF (PRESENT(zoom_ibegin_))      THEN
+         CALL cxios_set_domaingroup_zoom_ibegin(domaingroup_hdl%daddr, zoom_ibegin_)
+      END IF
+      IF (PRESENT(zoom_jbegin_))      THEN
+         CALL cxios_set_domaingroup_zoom_jbegin(domaingroup_hdl%daddr, zoom_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_loc_))      THEN
+         CALL cxios_set_domaingroup_zoom_ni_loc(domaingroup_hdl%daddr, zoom_ni_loc_)
+      END IF   
+      IF (PRESENT(zoom_nj_loc_))      THEN
+         CALL cxios_set_domaingroup_zoom_nj_loc(domaingroup_hdl%daddr, zoom_nj_loc_)
+      END IF
+      IF (PRESENT(zoom_ibegin_loc_))  THEN
+         CALL cxios_set_domaingroup_zoom_ibegin_loc(domaingroup_hdl%daddr, zoom_ibegin_loc_)
+      END IF
+      IF (PRESENT(zoom_jbegin_loc_))  THEN
+         CALL cxios_set_domaingroup_zoom_jbegin_loc(domaingroup_hdl%daddr, zoom_jbegin_loc_)
+      END IF
+      IF (PRESENT(data_n_index_))     THEN
+         CALL cxios_set_domaingroup_data_n_index(domaingroup_hdl%daddr, data_n_index_)
+      END IF
+      IF (PRESENT(data_i_index_))     THEN
+         CALL cxios_set_domaingroup_data_i_index(domaingroup_hdl%daddr, data_i_index_, size(data_i_index_, 1))
+      END IF
+      IF (PRESENT(data_j_index_))     THEN
+         CALL cxios_set_domaingroup_data_j_index(domaingroup_hdl%daddr, data_j_index_, size(data_j_index_, 1))
+      END IF
+      IF (PRESENT(lonvalue_))         THEN
+         CALL cxios_set_domaingroup_lonvalue(domaingroup_hdl%daddr, lonvalue_, size(lonvalue_, 1))
+      END IF
+      IF (PRESENT(latvalue_))         THEN
+         CALL cxios_set_domaingroup_latvalue(domaingroup_hdl%daddr, latvalue_, size(latvalue_, 1))
+      END IF
+
+   END SUBROUTINE set_domaingroup_attributes_hdl
+   
+   SUBROUTINE set_domain_attributes_id                                                                   &
+   ( domain_id, name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,  &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,         &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,       &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(XDomainHandle)                                   :: domain_hdl
+      CHARACTER(len = *)                       , INTENT(IN) :: domain_id
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)             , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*), OPTIONAL, INTENT(IN) :: mask_(:,:)
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                        , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)   , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)   , OPTIONAL, INTENT(IN) :: latvalue_(:)
+ 
+      CALL domain_handle_create(domain_hdl, domain_id)
+      CALL set_domain_attributes_hdl                                                                     &
+   ( domain_hdl, name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_, &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,         &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,       &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+
+   END SUBROUTINE set_domain_attributes_id
+   
+   SUBROUTINE set_domain_attributes_hdl                                                                  &
+   ( domain_hdl,name_, standard_name_, long_name_, domain_group_ref_, ni_glo_, nj_glo_, ibegin_, iend_,  &
+     ni_, jbegin_, jend_, nj_, mask_, data_dim_, data_ni_, data_nj_, data_ibegin_, data_jbegin_,         &
+     zoom_ni_, zoom_nj_, zoom_ibegin_, zoom_jbegin_, zoom_ni_loc_, zoom_nj_loc_, zoom_ibegin_loc_,       &
+     zoom_jbegin_loc_, data_n_index_, data_i_index_, data_j_index_, lonvalue_, latvalue_)
+      IMPLICIT NONE
+      TYPE(XDomainHandle)                        , INTENT(IN) :: domain_hdl
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)               , OPTIONAL, INTENT(IN) :: domain_group_ref_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_glo_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: iend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: jend_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: nj_
+      LOGICAL          , dimension(*)  , OPTIONAL, INTENT(IN) :: mask_(:,:)
+      LOGICAL(kind = 1), dimension(:,:), ALLOCATABLE          :: mask__
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_dim_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ni_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_nj_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_ibegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: zoom_jbegin_loc_
+      INTEGER                          , OPTIONAL, INTENT(IN) :: data_n_index_
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_i_index_(:)
+      INTEGER       , dimension(*)     , OPTIONAL, INTENT(IN) :: data_j_index_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: lonvalue_(:)
+      REAL(kind = 8), dimension(*)     , OPTIONAL, INTENT(IN) :: latvalue_(:)
+      IF (PRESENT(name_))             THEN
+         CALL cxios_set_domain_name(domain_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))    THEN
+         CALL cxios_set_domain_standard_name(domain_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))        THEN
+         CALL cxios_set_domain_long_name(domain_hdl%daddr, long_name_, len(long_name_))
+       END IF
+      IF (PRESENT(domain_group_ref_)) THEN
+         CALL cxios_set_domain_domain_group_ref(domain_hdl%daddr, domain_group_ref_, len(domain_group_ref_))
+      END IF
+      IF (PRESENT(ni_glo_))           THEN
+         CALL cxios_set_domain_ni_glo(domain_hdl%daddr, ni_glo_)
+      END IF
+      IF (PRESENT(nj_glo_))           THEN
+         CALL cxios_set_domain_nj_glo(domain_hdl%daddr, nj_glo_)
+      END IF
+      IF (PRESENT(ibegin_))           THEN
+         CALL cxios_set_domain_ibegin(domain_hdl%daddr, ibegin_)
+       END IF
+      IF (PRESENT(iend_))             THEN
+         CALL cxios_set_domain_iend(domain_hdl%daddr, iend_)
+      END IF
+      IF (PRESENT(ni_))               THEN
+         CALL cxios_set_domain_ni(domain_hdl%daddr, ni_)
+      END IF
+      IF (PRESENT(jbegin_))           THEN
+         CALL cxios_set_domain_jbegin(domain_hdl%daddr, jbegin_)
+      END IF
+      IF (PRESENT(jend_))             THEN
+         CALL cxios_set_domain_jend(domain_hdl%daddr, jend_)
+      END IF
+      IF (PRESENT(nj_))               THEN
+         CALL cxios_set_domain_nj(domain_hdl%daddr, nj_)
+      END IF
+      IF (PRESENT(mask_))             THEN
+         ALLOCATE(mask__(size(mask_, 1), size(mask_, 2)))
+         mask__(:,:) = mask_(:,:)
+         CALL cxios_set_domain_mask(domain_hdl%daddr, mask__, size(mask_, 1), size(mask_, 2))         
+         DEALLOCATE(mask__)
+      END IF
+      IF (PRESENT(data_dim_))         THEN
+         CALL cxios_set_domain_data_dim(domain_hdl%daddr, data_dim_)
+      END IF
+      IF (PRESENT(data_ni_))          THEN
+         CALL cxios_set_domain_data_ni(domain_hdl%daddr, data_ni_)
+      END IF 
+      IF (PRESENT(data_nj_))          THEN
+         CALL cxios_set_domain_data_nj(domain_hdl%daddr, data_nj_)
+      END IF
+      IF (PRESENT(data_ibegin_))      THEN
+         CALL cxios_set_domain_data_ibegin(domain_hdl%daddr, data_ibegin_)
+      END IF
+      IF (PRESENT(data_jbegin_))      THEN
+         CALL cxios_set_domain_data_jbegin(domain_hdl%daddr, data_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_))          THEN
+         CALL cxios_set_domain_zoom_ni(domain_hdl%daddr, zoom_ni_)
+      END IF
+      IF (PRESENT(zoom_nj_))          THEN
+       CALL cxios_set_domain_zoom_nj(domain_hdl%daddr, zoom_nj_)
+      END IF
+      IF (PRESENT(zoom_ibegin_))      THEN
+         CALL cxios_set_domain_zoom_ibegin(domain_hdl%daddr, zoom_ibegin_)
+      END IF
+      IF (PRESENT(zoom_jbegin_))      THEN
+         CALL cxios_set_domain_zoom_jbegin(domain_hdl%daddr, zoom_jbegin_)
+      END IF
+      IF (PRESENT(zoom_ni_loc_))      THEN
+         CALL cxios_set_domain_zoom_ni_loc(domain_hdl%daddr, zoom_ni_loc_)
+      END IF   
+      IF (PRESENT(zoom_nj_loc_))      THEN
+         CALL cxios_set_domain_zoom_nj_loc(domain_hdl%daddr, zoom_nj_loc_)
+      END IF
+      IF (PRESENT(zoom_ibegin_loc_))  THEN
+         CALL cxios_set_domain_zoom_ibegin_loc(domain_hdl%daddr, zoom_ibegin_loc_)
+      END IF
+      IF (PRESENT(zoom_jbegin_loc_))  THEN
+         CALL cxios_set_domain_zoom_jbegin_loc(domain_hdl%daddr, zoom_jbegin_loc_)
+      END IF
+      IF (PRESENT(data_n_index_))     THEN
+         CALL cxios_set_domain_data_n_index(domain_hdl%daddr, data_n_index_)
+      END IF
+      IF (PRESENT(data_i_index_))     THEN
+         CALL cxios_set_domain_data_i_index(domain_hdl%daddr, data_i_index_, size(data_i_index_, 1))
+      END IF
+      IF (PRESENT(data_j_index_))     THEN
+         CALL cxios_set_domain_data_j_index(domain_hdl%daddr, data_j_index_, size(data_j_index_, 1))
+      END IF
+      IF (PRESENT(lonvalue_))         THEN
+         CALL cxios_set_domain_lonvalue(domain_hdl%daddr, lonvalue_, size(lonvalue_, 1))
+      END IF
+      IF (PRESENT(latvalue_))         THEN
+         CALL cxios_set_domain_latvalue(domain_hdl%daddr, latvalue_, size(latvalue_, 1))
+      END IF
+
+   END SUBROUTINE set_domain_attributes_hdl
+   
+   SUBROUTINE domain_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XDomainHandle), INTENT(OUT):: ret
+      CHARACTER(len = *) , INTENT(IN) :: idt      
+      CALL cxios_domain_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE domain_handle_create
+   
+   SUBROUTINE domaingroup_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XDomainGroupHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)      , INTENT(IN) :: idt      
+      CALL cxios_domaingroup_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE domaingroup_handle_create
+
+   LOGICAL FUNCTION domain_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_domain_valid_id(val, idt, len(idt));
+      domain_valid_id = val
+   END FUNCTION  domain_valid_id
+
+   LOGICAL FUNCTION domaingroup_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_domaingroup_valid_id(val, idt, len(idt));
+      domaingroup_valid_id = val
+   END FUNCTION  domaingroup_valid_id
+   
+END MODULE IDOMAIN
Index: /XIOS/trunk/src/fortran/ifield.F90
===================================================================
--- /XIOS/trunk/src/fortran/ifield.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/ifield.F90	(revision 306)
@@ -0,0 +1,555 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IFIELD
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE FIELD_INTERFACE
+   USE FIELDGROUP_INTERFACE
+   
+   TYPE XFieldHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XFieldHandle
+   
+   TYPE XFieldGroupHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XFieldGroupHandle
+
+   TYPE txios(field)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(field)
+   
+   TYPE txios(fieldgroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(fieldgroup)
+   
+   !----------------------------------------------------------------------------
+   INTERFACE set_field_attributes
+      MODULE PROCEDURE set_field_attributes_id,set_field_attributes_hdl
+   END INTERFACE  
+   
+   INTERFACE set_field_group_attributes
+      MODULE PROCEDURE set_fieldgroup_attributes_id,set_fieldgroup_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+   SUBROUTINE xios(set_fieldgroup_attr)                                             &
+   (fieldgroup_id, name, standard_name, long_name, unit, operation, freq_op, level, &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+    
+      IMPLICIT NONE
+      TYPE(txios(fieldgroup))                      :: fieldgroup_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: fieldgroup_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op
+      INTEGER                , OPTIONAL, INTENT(IN) :: level
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value
+        
+      CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl)
+      CALL xios(set_fieldgroup_attr_hdl_)                                                  &
+         (fieldgroup_hdl, name, standard_name, long_name, unit, operation, freq_op, level, &
+          prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+
+   END SUBROUTINE xios(set_fieldgroup_attr)
+
+   SUBROUTINE xios(set_fieldgroup_attr_hdl)                                           &
+   (fieldgroup_hdl, name, standard_name, long_name, unit, operation, freq_op, level , &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+      IMPLICIT NONE
+      TYPE(txios(fieldgroup))         , INTENT(IN) :: fieldgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op
+      INTEGER                , OPTIONAL, INTENT(IN) :: level
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value
+      
+      CALL  xios(set_fieldgroup_attr_hdl_)                                            &
+   (fieldgroup_hdl, name, standard_name, long_name, unit, operation, freq_op, level , &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value) 
+       
+   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
+
+
+   SUBROUTINE xios(set_fieldgroup_attr_hdl_)                                                &
+   (fieldgroup_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+      IMPLICIT NONE
+      TYPE(txios(fieldgroup))         , INTENT(IN) :: fieldgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL(kind = 1)                             :: enabled__
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_fieldgroup_name(fieldgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_fieldgroup_standard_name(fieldgroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_fieldgroup_long_name(fieldgroup_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_fieldgroup_unit(fieldgroup_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(operation_))      THEN
+         CALL cxios_set_fieldgroup_operation(fieldgroup_hdl%daddr, operation_, len(operation_))
+      END IF
+      IF (PRESENT(freq_op_))        THEN
+         CALL cxios_set_fieldgroup_freq_op(fieldgroup_hdl%daddr, freq_op_, len(freq_op_))
+      END IF
+      IF (PRESENT(level_))          THEN
+         CALL cxios_set_fieldgroup_level(fieldgroup_hdl%daddr, level_)
+      END IF
+      IF (PRESENT(prec_))           THEN
+         CALL cxios_set_fieldgroup_prec(fieldgroup_hdl%daddr, prec_)
+      END IF
+      IF (PRESENT(enabled_))        THEN
+         enabled__ = enabled_  
+         CALL cxios_set_fieldgroup_enabled(fieldgroup_hdl%daddr, enabled__)
+      END IF
+      IF (PRESENT(domain_ref_))     THEN
+         CALL cxios_set_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))       THEN
+         CALL cxios_set_fieldgroup_axis_ref(fieldgroup_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+      IF (PRESENT(grid_ref_))       THEN
+         CALL cxios_set_fieldgroup_grid_ref(fieldgroup_hdl%daddr, grid_ref_, len(grid_ref_))
+      END IF
+      IF (PRESENT(field_ref_))      THEN
+         CALL cxios_set_fieldgroup_field_ref(fieldgroup_hdl%daddr, field_ref_, len(field_ref_))
+      END IF
+      IF (PRESENT(default_value_))  THEN
+         CALL cxios_set_fieldgroup_default_value(fieldgroup_hdl%daddr, default_value_)
+      END IF
+
+   END SUBROUTINE xios(set_fieldgroup_attr_hdl_)
+
+   
+   SUBROUTINE xios(set_field_attr)                                             &
+   (field_id, name, standard_name, long_name, unit, operation, freq_op, level, &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+    
+      IMPLICIT NONE
+      TYPE(txios(field))                            :: field_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: field_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op
+      INTEGER                , OPTIONAL, INTENT(IN) :: level
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value
+      
+      CALL xios(get_field_handle)(field_id,field_hdl)
+      CALL xios(set_field_attr_hdl_)                                                          &
+         (field_hdl, name, standard_name, long_name, unit, operation, freq_op, level,  &
+          prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+   END SUBROUTINE xios(set_field_attr)
+
+
+   SUBROUTINE xios(set_field_attr_hdl)                                          &
+   (field_hdl, name, standard_name, long_name, unit, operation, freq_op, level, &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)
+      IMPLICIT NONE
+      TYPE(txios(field))               , INTENT(IN):: field_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op
+      INTEGER                , OPTIONAL, INTENT(IN) :: level
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value
+
+      CALL xios(set_field_attr_hdl_)                                            &
+   (field_hdl, name, standard_name, long_name, unit, operation, freq_op, level, &
+    prec, enabled, domain_ref, axis_ref, grid_ref, field_ref, default_value)  
+        
+   END SUBROUTINE xios(set_field_attr_hdl)
+
+   SUBROUTINE xios(set_field_attr_hdl_)                                                &
+   (field_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+      IMPLICIT NONE
+      TYPE(txios(field))               , INTENT(IN):: field_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL(kind = 1)                             :: enabled__
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_field_name(field_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_field_standard_name(field_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_field_long_name(field_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_field_unit(field_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(operation_))      THEN
+         CALL cxios_set_field_operation(field_hdl%daddr, operation_, len(operation_))
+      END IF
+      IF (PRESENT(freq_op_))        THEN
+         CALL cxios_set_field_freq_op(field_hdl%daddr, freq_op_, len(freq_op_))
+      END IF
+      IF (PRESENT(level_))          THEN
+         CALL cxios_set_field_level(field_hdl%daddr, level_)
+      END IF
+      IF (PRESENT(prec_))           THEN
+         CALL cxios_set_field_prec(field_hdl%daddr, prec_)
+      END IF
+      IF (PRESENT(enabled_))        THEN
+         enabled__ = enabled_  
+         CALL cxios_set_field_enabled(field_hdl%daddr, enabled__)
+      END IF
+      IF (PRESENT(domain_ref_))     THEN
+         CALL cxios_set_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))       THEN
+         CALL cxios_set_field_axis_ref(field_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+      IF (PRESENT(grid_ref_))       THEN
+         CALL cxios_set_field_grid_ref(field_hdl%daddr, grid_ref_, len(grid_ref_))
+      END IF
+      IF (PRESENT(field_ref_))      THEN
+         CALL cxios_set_field_field_ref(field_hdl%daddr, field_ref_, len(field_ref_))
+      END IF
+      IF (PRESENT(default_value_))  THEN
+         CALL cxios_set_field_default_value(field_hdl%daddr, default_value_)
+      END IF
+
+   END SUBROUTINE xios(set_field_attr_hdl_)
+   
+
+   SUBROUTINE xios(get_field_handle)(idt, ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN)   :: idt      
+      TYPE(txios(field)), INTENT(OUT) :: ret
+      CALL cxios_field_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE xios(get_field_handle)
+   
+   SUBROUTINE xios(get_fieldgroup_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)     , INTENT(IN) :: idt      
+      TYPE(txios(fieldgroup)), INTENT(OUT):: ret
+
+      CALL cxios_fieldgroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_fieldgroup_handle)
+   
+
+   LOGICAL FUNCTION xios(is_valid_field)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      
+      CALL cxios_field_valid_id(val, idt, len(idt));
+      xios(is_valid_field) = val
+
+   END FUNCTION  xios(is_valid_field)
+
+   LOGICAL FUNCTION xios(is_valid_fieldgroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_fieldgroup_valid_id(val, idt, len(idt));
+      xios(is_valid_fieldgroup) = val
+
+   END FUNCTION  xios(is_valid_fieldgroup)
+   
+   
+ 
+   
+   
+   
+   
+   
+   
+   
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!! Ancienne interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    
+   SUBROUTINE set_fieldgroup_attributes_id                                                 &
+   (fieldgroup_id, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+    
+      IMPLICIT NONE
+      TYPE(XFieldGroupHandle)                       :: fieldgroup_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: fieldgroup_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+        
+      CALL fieldgroup_handle_create(fieldgroup_hdl, fieldgroup_id)
+      CALL set_fieldgroup_attributes_hdl                                                          &
+         (fieldgroup_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+          prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+
+   END SUBROUTINE set_fieldgroup_attributes_id
+
+   SUBROUTINE set_fieldgroup_attributes_hdl                                                 &
+   (fieldgroup_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+      IMPLICIT NONE
+      TYPE(XFieldgroupHandle)          , INTENT(IN) :: fieldgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL(kind = 1)                             :: enabled__
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_fieldgroup_name(fieldgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_fieldgroup_standard_name(fieldgroup_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_fieldgroup_long_name(fieldgroup_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_fieldgroup_unit(fieldgroup_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(operation_))      THEN
+         CALL cxios_set_fieldgroup_operation(fieldgroup_hdl%daddr, operation_, len(operation_))
+      END IF
+      IF (PRESENT(freq_op_))        THEN
+         CALL cxios_set_fieldgroup_freq_op(fieldgroup_hdl%daddr, freq_op_, len(freq_op_))
+      END IF
+      IF (PRESENT(level_))          THEN
+         CALL cxios_set_fieldgroup_level(fieldgroup_hdl%daddr, level_)
+      END IF
+      IF (PRESENT(prec_))           THEN
+         CALL cxios_set_fieldgroup_prec(fieldgroup_hdl%daddr, prec_)
+      END IF
+      IF (PRESENT(enabled_))        THEN
+         enabled__ = enabled_  
+         CALL cxios_set_fieldgroup_enabled(fieldgroup_hdl%daddr, enabled__)
+      END IF
+      IF (PRESENT(domain_ref_))     THEN
+         CALL cxios_set_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))       THEN
+         CALL cxios_set_fieldgroup_axis_ref(fieldgroup_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+      IF (PRESENT(grid_ref_))       THEN
+         CALL cxios_set_fieldgroup_grid_ref(fieldgroup_hdl%daddr, grid_ref_, len(grid_ref_))
+      END IF
+      IF (PRESENT(field_ref_))      THEN
+         CALL cxios_set_fieldgroup_field_ref(fieldgroup_hdl%daddr, field_ref_, len(field_ref_))
+      END IF
+      IF (PRESENT(default_value_))  THEN
+         CALL cxios_set_fieldgroup_default_value(fieldgroup_hdl%daddr, default_value_)
+      END IF
+
+   END SUBROUTINE set_fieldgroup_attributes_hdl
+   
+   SUBROUTINE set_field_attributes_id                                                 &
+   (field_id, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+    
+      IMPLICIT NONE
+      TYPE(XFieldHandle)                            :: field_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: field_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+      
+      CALL field_handle_create(field_hdl, field_id)
+      CALL set_field_attributes_hdl                                                          &
+         (field_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+          prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+
+   END SUBROUTINE set_field_attributes_id
+
+   SUBROUTINE set_field_attributes_hdl                                                 &
+   (field_hdl, name_, standard_name_, long_name_, unit_, operation_, freq_op_, level_, &
+    prec_, enabled_, domain_ref_, axis_ref_, grid_ref_, field_ref_, default_value_)
+      IMPLICIT NONE
+      TYPE(XFieldHandle)               , INTENT(IN) :: field_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: standard_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: long_name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: unit_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: operation_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: freq_op_
+      INTEGER                , OPTIONAL, INTENT(IN) :: level_
+      INTEGER                , OPTIONAL, INTENT(IN) :: prec_
+      LOGICAL(kind = 1)                             :: enabled__
+      LOGICAL                , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: grid_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: field_ref_
+      REAL(kind=8)           , OPTIONAL, INTENT(IN) :: default_value_
+      
+      IF (PRESENT(name_))           THEN
+         CALL cxios_set_field_name(field_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(standard_name_))  THEN
+         CALL cxios_set_field_standard_name(field_hdl%daddr, standard_name_, len(standard_name_))
+      END IF
+      IF (PRESENT(long_name_))      THEN
+         CALL cxios_set_field_long_name(field_hdl%daddr, long_name_, len(long_name_))
+      END IF
+      IF (PRESENT(unit_))           THEN
+         CALL cxios_set_field_unit(field_hdl%daddr, unit_, len(unit_))
+      END IF
+      IF (PRESENT(operation_))      THEN
+         CALL cxios_set_field_operation(field_hdl%daddr, operation_, len(operation_))
+      END IF
+      IF (PRESENT(freq_op_))        THEN
+         CALL cxios_set_field_freq_op(field_hdl%daddr, freq_op_, len(freq_op_))
+      END IF
+      IF (PRESENT(level_))          THEN
+         CALL cxios_set_field_level(field_hdl%daddr, level_)
+      END IF
+      IF (PRESENT(prec_))           THEN
+         CALL cxios_set_field_prec(field_hdl%daddr, prec_)
+      END IF
+      IF (PRESENT(enabled_))        THEN
+         enabled__ = enabled_  
+         CALL cxios_set_field_enabled(field_hdl%daddr, enabled__)
+      END IF
+      IF (PRESENT(domain_ref_))     THEN
+         CALL cxios_set_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))       THEN
+         CALL cxios_set_field_axis_ref(field_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+      IF (PRESENT(grid_ref_))       THEN
+         CALL cxios_set_field_grid_ref(field_hdl%daddr, grid_ref_, len(grid_ref_))
+      END IF
+      IF (PRESENT(field_ref_))      THEN
+         CALL cxios_set_field_field_ref(field_hdl%daddr, field_ref_, len(field_ref_))
+      END IF
+      IF (PRESENT(default_value_))  THEN
+         CALL cxios_set_field_default_value(field_hdl%daddr, default_value_)
+      END IF
+
+   END SUBROUTINE set_field_attributes_hdl
+
+   SUBROUTINE field_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XFieldHandle), INTENT(OUT):: ret
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      CALL cxios_field_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE field_handle_create
+   
+   SUBROUTINE fieldgroup_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XFieldGroupHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)     , INTENT(IN) :: idt      
+      CALL cxios_fieldgroup_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE fieldgroup_handle_create
+
+   LOGICAL FUNCTION field_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_field_valid_id(val, idt, len(idt));
+      field_valid_id = val
+   END FUNCTION  field_valid_id
+
+   LOGICAL FUNCTION fieldgroup_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_fieldgroup_valid_id(val, idt, len(idt));
+      fieldgroup_valid_id = val
+   END FUNCTION  fieldgroup_valid_id
+
+END MODULE IFIELD
Index: /XIOS/trunk/src/fortran/ifile.F90
===================================================================
--- /XIOS/trunk/src/fortran/ifile.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/ifile.F90	(revision 306)
@@ -0,0 +1,366 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IFILE
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE FILE_INTERFACE
+   USE FILEGROUP_INTERFACE
+   
+   TYPE XFileHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XFileHandle
+   
+   TYPE XFileGroupHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XFileGroupHandle
+
+   TYPE txios(file)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(file)
+   
+   TYPE txios(filegroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(filegroup)
+   
+   !----------------------------------------------------------------------------
+   INTERFACE set_file_attributes
+      MODULE PROCEDURE set_file_attributes_id,set_file_attributes_hdl
+   END INTERFACE  
+   
+   INTERFACE set_file_group_attributes
+      MODULE PROCEDURE set_filegroup_attributes_id,set_filegroup_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+  
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+   SUBROUTINE xios(set_file_attr)(file_id, name , description, name_suffix, output_freq, output_level, enabled, type)
+      IMPLICIT NONE
+      TYPE(txios(file))                       :: file_hdl
+      CHARACTER(len = *)          , INTENT(IN) :: file_id
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type
+            
+      CALL xios(get_file_handle)(file_id,file_hdl)
+      CALL xios(set_file_attr_hdl_)(file_hdl, name , description, name_suffix, output_freq, output_level, enabled, type)
+      
+   END SUBROUTINE xios(set_file_attr)
+   
+
+   SUBROUTINE xios(set_file_attr_hdl)(file_hdl, name , description, name_suffix, output_freq, output_level, enabled,type)
+      TYPE(txios(file))          , INTENT(IN) :: file_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type
+
+      CALL xios(set_file_attr_hdl_)(file_hdl, name , description, name_suffix, output_freq, output_level, enabled, type)
+      
+   END SUBROUTINE xios(set_file_attr_hdl)
+
+   SUBROUTINE xios(set_file_attr_hdl_)(file_hdl, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_, type_)
+      TYPE(txios(file))          , INTENT(IN) :: file_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL(kind = 1)                        :: enabled__
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type_
+            
+      IF (PRESENT(name_))         THEN
+         CALL cxios_set_file_name(file_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_))  THEN
+         CALL cxios_set_file_description(file_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(name_suffix_))  THEN
+         CALL cxios_set_file_name_suffix(file_hdl%daddr, name_suffix_, len(name_suffix_))
+      END IF
+      IF (PRESENT(output_freq_))  THEN
+         CALL cxios_set_file_output_freq(file_hdl%daddr, output_freq_, len(output_freq_))
+      END IF
+      IF (PRESENT(output_level_)) THEN
+         CALL cxios_set_file_output_level(file_hdl%daddr, output_level_)
+      END IF
+      IF (PRESENT(enabled_))      THEN
+         enabled__ = enabled_        
+         CALL cxios_set_file_enabled(file_hdl%daddr, enabled__)
+      END IF
+      
+      IF (PRESENT(type_))         THEN
+         CALL cxios_set_file_type(file_hdl%daddr, type_, len(type_))
+      END IF
+      
+   END SUBROUTINE xios(set_file_attr_hdl_)
+
+
+   
+   SUBROUTINE xios(set_filegroup_attr)(filegroup_id, name , description, name_suffix, output_freq, output_level, enabled, type)
+      IMPLICIT NONE
+      TYPE(txios(filegroup))                  :: filegroup_hdl
+      CHARACTER(len = *)          , INTENT(IN) :: filegroup_id
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type
+      
+      CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
+      CALL xios(set_filegroup_attr_hdl_)(filegroup_hdl, name , description, name_suffix, output_freq, output_level, enabled, type)
+      
+   END SUBROUTINE xios(set_filegroup_attr)
+
+
+   SUBROUTINE xios(set_filegroup_attr_hdl)(filegroup_hdl, name , description, name_suffix, output_freq, output_level, enabled, type)
+      IMPLICIT NONE
+      TYPE(txios(filegroup))     , INTENT(IN) :: filegroup_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type
+      
+     CALL xios(set_filegroup_attr_hdl_)(filegroup_hdl, name , description, name_suffix, output_freq, output_level, enabled, type)
+
+   END SUBROUTINE xios(set_filegroup_attr_hdl)
+      
+   
+   SUBROUTINE xios(set_filegroup_attr_hdl_)(filegroup_hdl, name_ , description_, name_suffix_, output_freq_, output_level_,     &
+                   enabled_,type_)
+      IMPLICIT NONE
+      TYPE(txios(filegroup))     , INTENT(IN) :: filegroup_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL(kind = 1)                        :: enabled__
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: type_
+      
+      IF (PRESENT(name_))         THEN
+         CALL cxios_set_filegroup_name(filegroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_))  THEN
+         CALL cxios_set_filegroup_description(filegroup_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(name_suffix_))  THEN
+         CALL cxios_set_filegroup_name_suffix(filegroup_hdl%daddr, name_suffix_, len(name_suffix_))
+      END IF
+      IF (PRESENT(output_freq_))  THEN
+         CALL cxios_set_filegroup_output_freq(filegroup_hdl%daddr, output_freq_, len(output_freq_))
+      END IF
+      IF (PRESENT(output_level_)) THEN
+         CALL cxios_set_filegroup_output_level(filegroup_hdl%daddr, output_level_)
+      END IF
+      IF (PRESENT(enabled_))      THEN
+        enabled__ = enabled_ 
+        CALL cxios_set_filegroup_enabled(filegroup_hdl%daddr, enabled__)
+      END IF
+      
+      IF (PRESENT(type_))         THEN
+         CALL cxios_set_filegroup_type(filegroup_hdl%daddr, type_, len(type_))
+      END IF
+
+   END SUBROUTINE xios(set_filegroup_attr_hdl_)
+
+
+
+   SUBROUTINE xios(get_file_handle)( idt, ret)
+      IMPLICIT NONE
+      CHARACTER(len = *),   INTENT(IN) :: idt      
+      TYPE(txios(file)) , INTENT(OUT):: ret
+
+      CALL cxios_file_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_file_handle)
+   
+   SUBROUTINE xios(get_filegroup_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)    ,   INTENT(IN) :: idt      
+      TYPE(txios(filegroup)), INTENT(OUT):: ret
+
+      CALL cxios_filegroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_filegroup_handle)
+
+   LOGICAL FUNCTION xios(is_valid_file)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_file_valid_id(val, idt, len(idt));
+      xios(is_valid_file) = val
+
+   END FUNCTION  xios(is_valid_file)
+
+   LOGICAL FUNCTION xios(is_valid_filegroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_filegroup_valid_id(val, idt, len(idt));
+      xios(is_valid_filegroup) = val
+
+   END FUNCTION  xios(is_valid_filegroup)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+!!!!!!!!!!!!!! Anciennes interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   
+   SUBROUTINE set_file_attributes_id(file_id, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      IMPLICIT NONE
+      TYPE(XFileHandle)                        :: file_hdl
+      CHARACTER(len = *)          , INTENT(IN) :: file_id
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      
+      CALL file_handle_create(file_hdl, file_id)
+      CALL set_file_attributes_hdl(file_hdl, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      
+   END SUBROUTINE set_file_attributes_id
+   
+   SUBROUTINE set_file_attributes_hdl(file_hdl, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      TYPE(XFileHandle)           , INTENT(IN) :: file_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL(kind = 1)                        :: enabled__
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      
+      IF (PRESENT(name_))         THEN
+         CALL cxios_set_file_name(file_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_))  THEN
+         CALL cxios_set_file_description(file_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(name_suffix_))  THEN
+         CALL cxios_set_file_name_suffix(file_hdl%daddr, name_suffix_, len(name_suffix_))
+      END IF
+      IF (PRESENT(output_freq_))  THEN
+         CALL cxios_set_file_output_freq(file_hdl%daddr, output_freq_, len(output_freq_))
+      END IF
+      IF (PRESENT(output_level_)) THEN
+         CALL cxios_set_file_output_level(file_hdl%daddr, output_level_)
+      END IF
+      IF (PRESENT(enabled_))      THEN
+         enabled__ = enabled_        
+         CALL cxios_set_file_enabled(file_hdl%daddr, enabled__)
+      END IF
+
+   END SUBROUTINE set_file_attributes_hdl
+   
+   SUBROUTINE set_filegroup_attributes_id(filegroup_id, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      IMPLICIT NONE
+      TYPE(XFileGroupHandle)                   :: filegroup_hdl
+      CHARACTER(len = *)          , INTENT(IN) :: filegroup_id
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      
+      CALL filegroup_handle_create(filegroup_hdl, filegroup_id)
+      CALL set_filegroup_attributes_hdl(filegroup_hdl, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      
+   END SUBROUTINE set_filegroup_attributes_id
+   
+   SUBROUTINE set_filegroup_attributes_hdl(filegroup_hdl, name_ , description_, name_suffix_, output_freq_, output_level_, enabled_)
+      IMPLICIT NONE
+      TYPE(XFileGroupHandle)      , INTENT(IN) :: filegroup_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_suffix_
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+      INTEGER           , OPTIONAL, INTENT(IN) :: output_level_
+      LOGICAL(kind = 1)                        :: enabled__
+      LOGICAL           , OPTIONAL, INTENT(IN) :: enabled_
+      
+      IF (PRESENT(name_))         THEN
+         CALL cxios_set_filegroup_name(filegroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_))  THEN
+         CALL cxios_set_filegroup_description(filegroup_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(name_suffix_))  THEN
+         CALL cxios_set_filegroup_name_suffix(filegroup_hdl%daddr, name_suffix_, len(name_suffix_))
+      END IF
+      IF (PRESENT(output_freq_))  THEN
+         CALL cxios_set_filegroup_output_freq(filegroup_hdl%daddr, output_freq_, len(output_freq_))
+      END IF
+      IF (PRESENT(output_level_)) THEN
+         CALL cxios_set_filegroup_output_level(filegroup_hdl%daddr, output_level_)
+      END IF
+      IF (PRESENT(enabled_))      THEN
+        enabled__ = enabled_ 
+        CALL cxios_set_filegroup_enabled(filegroup_hdl%daddr, enabled__)
+      END IF
+
+   END SUBROUTINE set_filegroup_attributes_hdl
+   
+   SUBROUTINE file_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XFileHandle) , INTENT(OUT):: ret
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      CALL cxios_file_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE file_handle_create
+   
+   SUBROUTINE filegroup_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XFileGroupHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)    , INTENT(IN) :: idt      
+      CALL cxios_filegroup_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE filegroup_handle_create
+
+   LOGICAL FUNCTION file_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_file_valid_id(val, idt, len(idt));
+      file_valid_id = val
+   END FUNCTION  file_valid_id
+
+   LOGICAL FUNCTION filegroup_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_filegroup_valid_id(val, idt, len(idt));
+      filegroup_valid_id = val
+   END FUNCTION  filegroup_valid_id
+   
+END MODULE IFILE
Index: /XIOS/trunk/src/fortran/igrid.F90
===================================================================
--- /XIOS/trunk/src/fortran/igrid.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/igrid.F90	(revision 306)
@@ -0,0 +1,302 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IGRID
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE GRID_INTERFACE
+   USE GRIDGROUP_INTERFACE
+   
+   TYPE XGridHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XGridHandle
+   
+   TYPE XGridGroupHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XGridGroupHandle
+
+   TYPE txios(grid)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(grid)
+   
+   TYPE txios(gridgroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(gridgroup)
+   
+   !----------------------------------------------------------------------------
+   INTERFACE set_grid_attributes
+      MODULE PROCEDURE set_grid_attributes_id,set_grid_attributes_hdl
+   END INTERFACE  
+   
+   INTERFACE set_grid_group_attributes
+      MODULE PROCEDURE set_gridgroup_attributes_id,set_gridgroup_attributes_hdl
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+
+   SUBROUTINE xios(set_grid_attr)(grid_id, name, description, domain_ref, axis_ref)
+      IMPLICIT NONE
+      TYPE(txios(grid))                             :: grid_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: grid_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      
+      CALL xios(get_grid_handle)(grid_id,grid_hdl)
+      CALL xios(set_grid_attr_hdl_)(grid_hdl, name, description, domain_ref, axis_ref)
+
+   END SUBROUTINE xios(set_grid_attr)
+   
+   SUBROUTINE xios(set_grid_attr_hdl)(grid_hdl, name, description, domain_ref, axis_ref)
+      IMPLICIT NONE
+      TYPE      (txios(grid))                      :: grid_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      
+      CALL xios(set_grid_attr_hdl_)(grid_hdl, name, description, domain_ref, axis_ref)
+
+   END SUBROUTINE xios(set_grid_attr_hdl)   
+
+
+   SUBROUTINE xios(set_grid_attr_hdl_)(grid_hdl, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE      (txios(grid))                      :: grid_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      IF (PRESENT(name_))        THEN
+       CALL cxios_set_grid_name(grid_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_)) THEN
+       CALL cxios_set_grid_description(grid_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(domain_ref_))  THEN
+       CALL cxios_set_grid_domain_ref(grid_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))    THEN
+       CALL cxios_set_grid_axis_ref(grid_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+   END SUBROUTINE xios(set_grid_attr_hdl_)
+
+
+   
+   SUBROUTINE xios(set_gridgroup_attr)(gridgroup_id, name, description, domain_ref, axis_ref)
+      IMPLICIT NONE
+      TYPE(txios(gridgroup))                       :: gridgroup_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: gridgroup_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+      
+      CALL xios(get_gridgroup_handle)(gridgroup_id, gridgroup_hdl)
+      CALL xios(set_gridgroup_attr_hdl_)(gridgroup_hdl, name, description, domain_ref, axis_ref)
+
+   END SUBROUTINE xios(set_gridgroup_attr)
+   
+   SUBROUTINE xios(set_gridgroup_attr_hdl)(gridgroup_hdl, name, description, domain_ref, axis_ref)
+      IMPLICIT NONE
+      TYPE      (txios(gridgroup))                 :: gridgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref
+
+      CALL xios(set_gridgroup_attr_hdl_)(gridgroup_hdl, name, description, domain_ref, axis_ref)
+
+   END SUBROUTINE xios(set_gridgroup_attr_hdl)
+   
+   SUBROUTINE xios(set_gridgroup_attr_hdl_)(gridgroup_hdl, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE      (txios(gridgroup))                 :: gridgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      IF (PRESENT(name_))        THEN
+       CALL cxios_set_gridgroup_name(gridgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_)) THEN
+       CALL cxios_set_gridgroup_description(gridgroup_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(domain_ref_))  THEN
+       CALL cxios_set_gridgroup_domain_ref(gridgroup_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))    THEN
+       CALL cxios_set_gridgroup_axis_ref(gridgroup_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+   END SUBROUTINE xios(set_gridgroup_attr_hdl_)
+   
+   
+
+   SUBROUTINE xios(get_grid_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      TYPE(txios(grid)), INTENT(OUT):: ret
+
+      CALL cxios_grid_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_grid_handle)
+   
+   SUBROUTINE xios(get_gridgroup_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)     , INTENT(IN) :: idt      
+      TYPE(txios(gridgroup))     , INTENT(OUT):: ret
+
+      CALL cxios_gridgroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_gridgroup_handle)
+
+   LOGICAL FUNCTION xios(is_valid_grid)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_grid_valid_id(val, idt, len(idt));
+      xios(is_valid_grid) = val
+
+   END FUNCTION  xios(is_valid_grid)
+
+   LOGICAL FUNCTION xios(is_valid_gridgroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_gridgroup_valid_id(val, idt, len(idt));
+      xios(is_valid_gridgroup) = val
+
+   END FUNCTION  xios(is_valid_gridgroup)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+!!!!!!!!!!!!!!!!!!!!  Anciennes interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   
+   SUBROUTINE set_grid_attributes_id(grid_id, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE(XGridHandle)                             :: grid_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: grid_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      CALL grid_handle_create(grid_hdl, grid_id)
+      CALL set_grid_attributes_hdl(grid_hdl, name_, description_, domain_ref_, axis_ref_)
+
+   END SUBROUTINE set_grid_attributes_id
+
+   SUBROUTINE set_grid_attributes_hdl(grid_hdl, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE      (XGridHandle)                       :: grid_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      IF (PRESENT(name_))        THEN
+       CALL cxios_set_grid_name(grid_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_)) THEN
+       CALL cxios_set_grid_description(grid_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(domain_ref_))  THEN
+       CALL cxios_set_grid_domain_ref(grid_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))    THEN
+       CALL cxios_set_grid_axis_ref(grid_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+   END SUBROUTINE set_grid_attributes_hdl
+   
+   SUBROUTINE set_gridgroup_attributes_id(gridgroup_id, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE(XGridGroupHandle)                        :: gridgroup_hdl
+      CHARACTER(len = *)               , INTENT(IN) :: gridgroup_id
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      CALL gridgroup_handle_create(gridgroup_hdl, gridgroup_id)
+      CALL set_gridgroup_attributes_hdl(gridgroup_hdl, name_, description_, domain_ref_, axis_ref_)
+
+   END SUBROUTINE set_gridgroup_attributes_id
+
+   SUBROUTINE set_gridgroup_attributes_hdl(gridgroup_hdl, name_, description_, domain_ref_, axis_ref_)
+      IMPLICIT NONE
+      TYPE      (XGridGroupHandle)                  :: gridgroup_hdl
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: description_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: domain_ref_
+      CHARACTER(len = *)     , OPTIONAL, INTENT(IN) :: axis_ref_
+      
+      IF (PRESENT(name_))        THEN
+       CALL cxios_set_gridgroup_name(gridgroup_hdl%daddr, name_, len(name_))
+      END IF
+      IF (PRESENT(description_)) THEN
+       CALL cxios_set_gridgroup_description(gridgroup_hdl%daddr, description_, len(description_))
+      END IF
+      IF (PRESENT(domain_ref_))  THEN
+       CALL cxios_set_gridgroup_domain_ref(gridgroup_hdl%daddr, domain_ref_, len(domain_ref_))
+      END IF
+      IF (PRESENT(axis_ref_))    THEN
+       CALL cxios_set_gridgroup_axis_ref(gridgroup_hdl%daddr, axis_ref_, len(axis_ref_))
+      END IF
+   END SUBROUTINE set_gridgroup_attributes_hdl
+
+   SUBROUTINE grid_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XGridHandle), INTENT(OUT):: ret
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      CALL cxios_grid_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE grid_handle_create
+   
+   SUBROUTINE gridgroup_handle_create(ret, idt)
+      IMPLICIT NONE
+      TYPE(XGridGroupHandle), INTENT(OUT):: ret
+      CHARACTER(len = *)     , INTENT(IN) :: idt      
+      CALL cxios_gridgroup_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE gridgroup_handle_create
+
+   LOGICAL FUNCTION grid_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_grid_valid_id(val, idt, len(idt));
+      grid_valid_id = val
+   END FUNCTION  grid_valid_id
+
+   LOGICAL FUNCTION gridgroup_valid_id(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      CALL cxios_gridgroup_valid_id(val, idt, len(idt));
+      gridgroup_valid_id = val
+   END FUNCTION  gridgroup_valid_id
+   
+END MODULE IGRID
Index: /XIOS/trunk/src/fortran/ixios.F90
===================================================================
--- /XIOS/trunk/src/fortran/ixios.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/ixios.F90	(revision 306)
@@ -0,0 +1,95 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE XIOS
+
+
+USE icontext, ONLY : txios(context), xios(set_context_attr), xios(set_context_attr_hdl),   &
+                     xios(get_context_handle), xios(set_current_context),                  &
+                     xios(is_valid_context)
+
+USE idata, ONLY : xios(initialize),xios(init_server), xios(finalize), xios(context_initialize),  &
+                  xios(close_context_definition),       &
+                  xios(context_finalize), xios(send_field_r8_1d), xios(send_field_r8_2d), &
+                  xios(send_field_r8_3d), xios(send_field_r4_1d), xios(send_field_r4_2d), &
+                  xios(send_field_r4_3d)
+
+USE idate, ONLY : txios(date),txios(time), xios(set_timestep),xios(update_calendar)
+
+USE idomain, ONLY : txios(domain), txios(domaingroup), xios(set_domaingroup_attr),       &
+                    xios(set_domaingroup_attr_hdl), xios(set_domain_attr), xios(set_domain_attr_hdl),&
+                    xios(get_domain_handle), xios(get_domaingroup_handle),xios(is_valid_domain),     &
+                    xios(is_valid_domaingroup)
+                     
+USE ifield, ONLY : txios(field), txios(fieldgroup), xios(set_fieldgroup_attr),           &
+                   xios(set_fieldgroup_attr_hdl),xios(set_field_attr),xios(set_field_attr_hdl),      &
+                   xios(get_field_handle), xios(get_fieldgroup_handle), xios(is_valid_field),        &
+                   xios(is_valid_fieldgroup)  
+                   
+USE ifile, ONLY : txios(file), txios(filegroup), xios(set_file_attr),xios(set_file_attr_hdl), &
+                  xios(set_filegroup_attr), xios(set_filegroup_attr_hdl), xios(get_file_handle),    & 
+                  xios(get_filegroup_handle), xios(is_valid_file), xios(is_valid_filegroup)
+                  
+USE igrid, ONLY : txios(grid), txios(gridgroup), xios(set_grid_attr), xios(set_grid_attr_hdl), &
+                  xios(set_gridgroup_attr), xios(set_gridgroup_attr_hdl), xios(get_grid_handle),     &
+                  xios(get_gridgroup_handle), xios(is_valid_grid), xios(is_valid_gridgroup) 
+
+USE iaxis, ONLY : txios(axis), txios(axisgroup), xios(set_axis_attr), xios(set_axis_attr_hdl), &
+                  xios(set_axisgroup_attr), xios(set_axisgroup_attr_hdl), xios(get_axis_handle),     &
+                  xios(get_axisgroup_handle), xios(is_valid_axis), xios(is_valid_axisgroup) 
+
+USE ixml_tree, ONLY : xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),          &
+                     xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), &
+                     xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile)
+                  
+
+PRIVATE
+
+
+INTERFACE xios(set_attr)
+  MODULE PROCEDURE xios(set_domaingroup_attr_hdl), xios(set_domain_attr_hdl), xios(set_fieldgroup_attr_hdl), &
+                   xios(set_field_attr_hdl), xios(set_file_attr_hdl), xios(set_filegroup_attr_hdl),          &
+                   xios(set_grid_attr_hdl), xios(set_gridgroup_attr_hdl), xios(set_axis_attr_hdl) ,          &
+                   xios(set_axisgroup_attr_hdl), xios(set_context_attr_hdl)
+END INTERFACE xios(set_attr)
+
+INTERFACE xios(get_handle)
+  MODULE PROCEDURE  xios(get_context_handle), xios(get_domain_handle), xios(get_domaingroup_handle),        &
+                    xios(get_file_handle), xios(get_filegroup_handle), xios(get_grid_handle),               &
+                    xios(get_gridgroup_handle), xios(get_axis_handle), xios(get_axisgroup_handle),          &
+                    xios(get_field_handle), xios(get_fieldgroup_handle)
+END INTERFACE xios(get_handle) 
+
+INTERFACE xios(add_child)
+  MODULE PROCEDURE xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),    &
+                   xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), &
+                   xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile)
+END INTERFACE xios(add_child)
+
+
+INTERFACE xios(send_field)
+  MODULE PROCEDURE  xios(send_field_r8_1d), xios(send_field_r8_2d), xios(send_field_r8_3d),              &
+                    xios(send_field_r4_1d), xios(send_field_r4_2d), xios(send_field_r4_3d)
+END INTERFACE xios(send_field)
+
+  
+ PUBLIC :: txios(domain), txios(domaingroup),txios(field), txios(fieldgroup),txios(file), txios(filegroup), &
+          txios(grid), txios(gridgroup), txios(axis), txios(axisgroup),txios(context), txios(date),txios(time)  
+
+ PUBLIC :: xios(set_attr), xios(set_domain_attr), xios(set_domaingroup_attr), xios(set_fieldgroup_attr), &
+          xios(set_field_attr), xios(set_file_attr), xios(set_filegroup_attr),          &
+          xios(set_grid_attr), xios(set_gridgroup_attr), xios(set_axis_attr) ,          &
+          xios(set_axisgroup_attr), xios(set_context_attr)
+
+ PUBLIC :: xios(get_handle) 
+ PUBLIC :: xios(add_child) 
+
+ PUBLIC :: xios(is_valid_context),xios(is_valid_domain), xios(is_valid_domaingroup),xios(is_valid_field),        &
+          xios(is_valid_fieldgroup), xios(is_valid_file), xios(is_valid_filegroup), xios(is_valid_grid),         &
+          xios(is_valid_gridgroup), xios(is_valid_axis), xios(is_valid_axisgroup)
+          
+ PUBLIC :: xios(set_current_context)  
+ PUBLIC :: xios(set_timestep),xios(update_calendar)
+ PUBLIC :: xios(initialize), xios(init_server), xios(finalize), xios(context_initialize),                       &
+           xios(close_context_definition), xios(context_finalize), xios(send_field)
+
+END MODULE XIOS
Index: /XIOS/trunk/src/fortran/ixml_tree.F90
===================================================================
--- /XIOS/trunk/src/fortran/ixml_tree.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/ixml_tree.F90	(revision 306)
@@ -0,0 +1,488 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IXML_TREE
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE IAXIS
+   USE IFILE
+   USE IFIELD
+   USE IGRID
+   USE IDOMAIN
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_xml_tree_add_field(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_field
+      
+      SUBROUTINE cxios_xml_tree_add_grid(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_grid
+      
+      SUBROUTINE cxios_xml_tree_add_file(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_file
+      
+      SUBROUTINE cxios_xml_tree_add_axis(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_axis
+      
+      SUBROUTINE cxios_xml_tree_add_domain(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_domain
+      
+      SUBROUTINE cxios_xml_tree_add_fieldtofile(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_fieldtofile
+
+      SUBROUTINE cxios_xml_tree_add_fieldgroup(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_fieldgroup
+
+      SUBROUTINE cxios_xml_tree_add_gridgroup(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_gridgroup
+
+      SUBROUTINE cxios_xml_tree_add_filegroup(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_filegroup
+
+      SUBROUTINE cxios_xml_tree_add_axisgroup(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_axisgroup
+
+      SUBROUTINE cxios_xml_tree_add_domaingroup(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_domaingroup
+      
+      SUBROUTINE cxios_xml_tree_add_fieldgrouptofile(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_fieldgrouptofile    
+
+      SUBROUTINE cxios_xml_tree_show(filename, filename_size) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER  (kind = C_INT) , VALUE        :: filename_size
+      END SUBROUTINE cxios_xml_tree_show
+
+      SUBROUTINE cxios_xml_parse_file(filename, filename_size) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER  (kind = C_INT) , VALUE        :: filename_size
+      END SUBROUTINE cxios_xml_parse_file
+
+      SUBROUTINE cxios_xml_parse_string(xmlcontent, xmlcontent_size) BIND(C)
+         USE ISO_C_BINDING
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: xmlcontent
+         INTEGER  (kind = C_INT) , VALUE        :: xmlcontent_size
+      END SUBROUTINE cxios_xml_parse_string
+     
+   END INTERFACE
+   
+   !----------------------------------------------------------------------------
+   INTERFACE xml_tree_add
+      MODULE PROCEDURE xml_tree_add_axis,   xml_tree_add_axisgroup,    &
+                       xml_tree_add_file,   xml_tree_add_filegroup,    &
+                       xml_tree_add_grid,   xml_tree_add_gridgroup,    &
+                       xml_tree_add_field,  xml_tree_add_fieldgroup,   &
+                       xml_tree_add_domain, xml_tree_add_domaingroup,  &
+                       xml_tree_add_fieldgrouptofile, xml_tree_add_fieldtofile
+   END INTERFACE  
+   !----------------------------------------------------------------------------
+   
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+
+   SUBROUTINE xios(add_axis)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(axisgroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(axis))          , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_axis)
+   
+   SUBROUTINE xios(add_file)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(filegroup))      , INTENT(IN) :: parent_hdl
+      TYPE(txios(file))           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN)  :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_file)
+   
+   SUBROUTINE xios(add_grid)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(gridgroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(grid))          , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_grid)
+   
+   
+   SUBROUTINE xios(add_field)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(fieldgroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(field))          , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_field)
+   
+   
+   SUBROUTINE xios(add_domain)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(domaingroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(domain))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_domain)
+   
+   SUBROUTINE xios(add_fieldtofile)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(file))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(field))           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_fieldtofile)
+
+
+   SUBROUTINE xios(add_axisgroup)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(axisgroup))      , INTENT(IN) :: parent_hdl
+      TYPE(txios(axisgroup))      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_axisgroup)
+
+
+   SUBROUTINE xios(add_filegroup)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(filegroup))      , INTENT(IN) :: parent_hdl
+      TYPE(txios(filegroup))      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_filegroup)
+
+   SUBROUTINE xios(add_gridgroup)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(gridgroup))      , INTENT(IN) :: parent_hdl
+      TYPE(txios(gridgroup))      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+      
+   END SUBROUTINE xios(add_gridgroup)
+
+
+   SUBROUTINE xios(add_fieldgroup)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(fieldgroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(fieldgroup))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xios(add_fieldgroup)
+
+   SUBROUTINE xios(add_domaingroup)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(domaingroup))     , INTENT(IN) :: parent_hdl
+      TYPE(txios(domaingroup))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_domaingroup)
+
+   SUBROUTINE xios(add_fieldgrouptofile)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(file))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(fieldgroup))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL  , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_fieldgrouptofile)
+
+!   SUBROUTINE xml_tree_show(filename)
+!      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: filename
+!      IF (PRESENT(filename)) THEN
+!         CALL cxios_xml_tree_show(filename, len(filename))
+!      ELSE
+!         CALL cxios_xml_tree_show("NONE", -1)
+!      END IF
+!   END SUBROUTINE xml_tree_show
+   
+!   SUBROUTINE xml_parse_file(filename)
+!      CHARACTER(len = *), INTENT(IN) :: filename
+!      CALL cxios_xml_parse_file(filename, len(filename))
+!   END SUBROUTINE xml_Parse_File
+   
+!   SUBROUTINE xml_parse_string(xmlcontent)
+!      CHARACTER(len = *), INTENT(IN) :: xmlcontent
+!      CALL cxios_xml_parse_string(xmlcontent, len(xmlcontent))
+!   END SUBROUTINE xml_Parse_String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+!!!!!!!!!!!!! Anciennes interfaces !!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE xml_tree_add_axis(parent_hdl, child_hdl, child_id)
+      TYPE(XAxisGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XAxisHandle)           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_axis(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_axis
+   
+   SUBROUTINE xml_tree_add_file(parent_hdl, child_hdl, child_id)
+      TYPE(XFileGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XFileHandle)           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_file(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_file
+   
+   SUBROUTINE xml_tree_add_grid(parent_hdl, child_hdl, child_id)
+      TYPE(XGridGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XGridHandle)           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_grid(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_grid
+   
+   SUBROUTINE xml_tree_add_field(parent_hdl, child_hdl, child_id)
+      TYPE(XFieldGroupHandle)     , INTENT(IN) :: parent_hdl
+      TYPE(XFieldHandle)          , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_field(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_field
+   
+   SUBROUTINE xml_tree_add_domain(parent_hdl, child_hdl, child_id)
+      TYPE(XDomainGroupHandle)     , INTENT(IN) :: parent_hdl
+      TYPE(XDomainHandle)          , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_domain(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_domain
+   
+   SUBROUTINE xml_tree_add_fieldtofile(parent_hdl, child_hdl, child_id)
+      TYPE(XFileHandle)            , INTENT(IN) :: parent_hdl
+      TYPE(XFieldHandle)           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldtofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_fieldtofile
+
+   SUBROUTINE xml_tree_add_axisgroup(parent_hdl, child_hdl, child_id)
+      TYPE(XAxisGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XAxisGroupHandle)      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_axisgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_axisgroup
+
+   SUBROUTINE xml_tree_add_filegroup(parent_hdl, child_hdl, child_id)
+      TYPE(XFileGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XFileGroupHandle)      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_filegroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_filegroup
+
+   SUBROUTINE xml_tree_add_gridgroup(parent_hdl, child_hdl, child_id)
+      TYPE(XGridGroupHandle)      , INTENT(IN) :: parent_hdl
+      TYPE(XGridGroupHandle)      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_gridgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_gridgroup
+
+   SUBROUTINE xml_tree_add_fieldgroup(parent_hdl, child_hdl, child_id)
+      TYPE(XFieldGroupHandle)     , INTENT(IN) :: parent_hdl
+      TYPE(XFieldGroupHandle)     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldgroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_fieldgroup
+
+   SUBROUTINE xml_tree_add_domaingroup(parent_hdl, child_hdl, child_id)
+      TYPE(XDomainGroupHandle)     , INTENT(IN) :: parent_hdl
+      TYPE(XDomainGroupHandle)     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_domaingroup(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_domaingroup
+
+   SUBROUTINE xml_tree_add_fieldgrouptofile(parent_hdl, child_hdl, child_id)
+      TYPE(XFileHandle)            , INTENT(IN) :: parent_hdl
+      TYPE(XFieldGroupHandle)      , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_fieldgrouptofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add_fieldgrouptofile
+
+   SUBROUTINE xml_tree_show(filename)
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: filename
+      IF (PRESENT(filename)) THEN
+         CALL cxios_xml_tree_show(filename, len(filename))
+      ELSE
+         CALL cxios_xml_tree_show("NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_show
+   
+   SUBROUTINE xml_parse_file(filename)
+      CHARACTER(len = *), INTENT(IN) :: filename
+      CALL cxios_xml_parse_file(filename, len(filename))
+   END SUBROUTINE xml_Parse_File
+   
+   SUBROUTINE xml_parse_string(xmlcontent)
+      CHARACTER(len = *), INTENT(IN) :: xmlcontent
+      CALL cxios_xml_parse_string(xmlcontent, len(xmlcontent))
+   END SUBROUTINE xml_Parse_String
+      
+END MODULE IXML_TREE
Index: /XIOS/trunk/src/fortran/oasis_cinterface.cpp
===================================================================
--- /XIOS/trunk/src/fortran/oasis_cinterface.cpp	(revision 306)
+++ /XIOS/trunk/src/fortran/oasis_cinterface.cpp	(revision 306)
@@ -0,0 +1,41 @@
+#include "oasis_cinterface.hpp"
+#include <string>
+#include <mpi.h>
+
+namespace xmlioserver
+{ 
+ 
+  void oasis_init(const std::string& server_id)
+  {
+    fxios_oasis_init(server_id.data(),server_id.size()) ;
+  }
+  
+  void oasis_finalize(void)
+  {
+    fxios_oasis_finalize() ;
+  }
+  
+  void oasis_get_localcomm(MPI_Comm& comm)
+  {
+    MPI_Fint f_comm ;
+    
+    fxios_oasis_get_localcomm(&f_comm) ;
+    comm=MPI_Comm_f2c(f_comm) ;
+  }
+ 
+  void oasis_get_intracomm(MPI_Comm& comm_client_server,const std::string& server_id)
+  {
+    MPI_Fint f_comm ;
+    
+    fxios_oasis_get_intracomm(&f_comm,server_id.data(),server_id.size()) ;
+    comm_client_server=MPI_Comm_f2c(f_comm) ;
+  }
+ 
+  void oasis_get_intercomm(MPI_Comm& comm_client_server,const std::string& server_id)
+  {
+    MPI_Fint f_comm ;
+    
+    fxios_oasis_get_intercomm(&f_comm,server_id.data(),server_id.size()) ;
+    comm_client_server=MPI_Comm_f2c(f_comm) ;
+  }
+}
Index: /XIOS/trunk/src/fortran/oasis_cinterface.hpp
===================================================================
--- /XIOS/trunk/src/fortran/oasis_cinterface.hpp	(revision 306)
+++ /XIOS/trunk/src/fortran/oasis_cinterface.hpp	(revision 306)
@@ -0,0 +1,24 @@
+#ifndef __OASIS_CINTERFACE__
+#define __OASIS_CINTERFACE__
+#include <string>
+#include <mpi.h>
+
+extern "C"
+{
+
+  void fxios_oasis_init(const char* server_id,int str_len) ;
+  void fxios_oasis_finalize(void) ;
+  void fxios_oasis_get_localcomm(MPI_Fint* f_comm) ;
+  void fxios_oasis_get_intracomm(MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ;
+  void fxios_oasis_get_intercomm(MPI_Fint* f_comm_client_server,const char* client_id,int str_len) ;
+}
+ 
+namespace xmlioserver
+{
+  void oasis_init(const std::string& server_id) ;
+  void oasis_finalize(void) ;
+  void oasis_get_localcomm(MPI_Comm& comm) ;
+  void oasis_get_intracomm(MPI_Comm& comm_client_server,const std::string& server_id) ;
+  void oasis_get_intercomm(MPI_Comm& comm_client_server,const std::string& server_id) ;
+}
+#endif
Index: /XIOS/trunk/src/fortran/oasis_interface.F90
===================================================================
--- /XIOS/trunk/src/fortran/oasis_interface.F90	(revision 306)
+++ /XIOS/trunk/src/fortran/oasis_interface.F90	(revision 306)
@@ -0,0 +1,114 @@
+SUBROUTINE fxios_oasis_init(server_id,str_len) BIND(C,NAME="fxios_oasis_init")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OASIS
+  USE mod_prism_proto
+#endif
+    CHARACTER(kind = C_CHAR),DIMENSION(*) :: server_id
+    INTEGER(kind = C_INT),VALUE   :: str_len
+    
+    INTEGER                :: comp_id
+    CHARACTER(len=str_len) :: oasis_server_id
+    INTEGER                :: ierr
+    INTEGER :: i
+    
+    DO i=1,str_len
+      oasis_server_id(i:i)=server_id(i)
+    ENDDO
+
+#ifdef USE_OASIS
+    CALL prism_init_comp_proto (comp_id, oasis_server_id, ierr)
+#endif
+    PRINT *,"---> prism_init",oasis_server_id,ierr
+
+END SUBROUTINE fxios_oasis_init
+
+
+SUBROUTINE fxios_oasis_finalize BIND(C,NAME="fxios_oasis_finalize")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OASIS
+  USE mod_prism_proto
+#endif
+  IMPLICIT NONE
+  INTEGER :: ierr
+  
+#ifdef USE_OASIS
+    CALL prism_terminate_proto(ierr)
+#endif
+    
+END SUBROUTINE fxios_oasis_finalize
+
+
+SUBROUTINE fxios_oasis_get_localcomm(f_comm) BIND(C,NAME="fxios_oasis_get_localcomm")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OASIS
+!  USE mod_prism_get_localcomm_proto 
+#endif
+  IMPLICIT NONE
+  INTEGER(kind=C_INT) :: f_comm
+  
+  INTEGER :: comm
+  INTEGER :: ierr
+    
+#ifdef USE_OASIS
+    CALL prism_get_localcomm_proto(comm,ierr)
+#endif
+    f_comm=comm
+
+END SUBROUTINE fxios_oasis_get_localcomm
+
+
+
+
+SUBROUTINE fxios_oasis_get_intracomm(f_comm_client_server,client_id,str_len) BIND(C,NAME="fxios_oasis_get_intracomm")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OASIS
+  USE mod_prism_get_comm 
+#endif
+  IMPLICIT NONE
+  INTEGER(kind=C_INT) :: f_comm_client_server
+  CHARACTER,DIMENSION(*) :: client_id
+  INTEGER,VALUE          :: str_len
+  
+  INTEGER :: comm_client_server
+  CHARACTER(len=str_len) :: oasis_client_id
+  INTEGER :: ierr
+  INTEGER :: i
+    
+    DO i=1,str_len
+      oasis_client_id(i:i)=client_id(i)
+    ENDDO
+    
+#ifdef USE_OASIS
+    CALL prism_get_intracomm(comm_client_server,oasis_client_id,ierr)
+#endif
+
+    f_comm_client_server=comm_client_server
+
+END SUBROUTINE fxios_oasis_get_intracomm
+
+SUBROUTINE fxios_oasis_get_intercomm(f_comm_client_server,client_id,str_len) BIND(C,NAME="fxios_oasis_get_intercomm")
+  USE, INTRINSIC :: ISO_C_BINDING
+#ifdef USE_OASIS
+  USE mod_prism_get_comm 
+#endif
+  IMPLICIT NONE
+  INTEGER(kind=C_INT) :: f_comm_client_server
+  CHARACTER,DIMENSION(*) :: client_id
+  INTEGER,VALUE          :: str_len
+  
+  INTEGER :: comm_client_server
+  CHARACTER(len=str_len) :: oasis_client_id
+  INTEGER :: ierr
+  INTEGER :: i
+    
+    DO i=1,str_len
+      oasis_client_id(i:i)=client_id(i)
+    ENDDO
+    
+#ifdef USE_OASIS
+    CALL prism_get_intercomm(comm_client_server,oasis_client_id,ierr)
+#endif
+
+    f_comm_client_server=comm_client_server
+
+END SUBROUTINE fxios_oasis_get_intercomm
Index: /XIOS/trunk/src/fortran/xios_fortran_prefix.hpp
===================================================================
--- /XIOS/trunk/src/fortran/xios_fortran_prefix.hpp	(revision 306)
+++ /XIOS/trunk/src/fortran/xios_fortran_prefix.hpp	(revision 306)
@@ -0,0 +1,7 @@
+#ifndef __XIOS_SUFFIX__
+#define __XIOS_SUFFIX__
+
+#define xios(arg) xios_##arg
+#define txios(arg) xios_##arg
+
+#endif
Index: /XIOS/trunk/src/functor.cpp
===================================================================
--- /XIOS/trunk/src/functor.cpp	(revision 306)
+++ /XIOS/trunk/src/functor.cpp	(revision 306)
@@ -0,0 +1,59 @@
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CFunctor::CFunctor(const StdString & id, ARRAY(double, 1) doutput)
+         : SuperClass(id), doutput(doutput), nbcall(0)
+      { /* Ne rien faire de plus */  }
+
+      CFunctor::~CFunctor(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      ARRAY(double, 1) CFunctor::getDataOutput(void) const
+      { 
+         return (this->doutput);
+      }
+
+      //---------------------------------------------------------------
+
+      StdString CFunctor::toString(void) const
+      {
+         ERROR("CFunctor::toString()", << "Not implemented yet !");
+         return (SuperClass::getId());
+      }
+
+      void CFunctor::fromString(const StdString & str)
+      {
+         ERROR("CFunctor::fromString(str)",
+                << "[ str = " << str << "] Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+      ARRAY(double, 1) CFunctor::operator ()(const ARRAY(double, 1) dinput)
+      {
+         this->nbcall++;
+         if (dinput->size() != this->doutput->size())
+            ERROR("CFunctor::operator ()(dinput)",
+                   << "[ input size = "  << dinput->size()
+                   << ", output size = " << this->doutput->size() << " ]"
+                   << " size of input array !=  size of output array !");
+         this->apply(dinput, this->doutput);
+         return (this->doutput);
+      }
+
+      void CFunctor::final(void) 
+      {
+         this->nbcall = 0;
+      } 
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: /XIOS/trunk/src/functor.hpp
===================================================================
--- /XIOS/trunk/src/functor.hpp	(revision 306)
+++ /XIOS/trunk/src/functor.hpp	(revision 306)
@@ -0,0 +1,62 @@
+#ifndef __XMLIO_CFunctor__
+#define __XMLIO_CFunctor__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CFunctor : public CObject
+      {
+         /// DÃ©finition de type ///
+         typedef CObject SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Accesseurs ///
+            DoubleArray getDataOutput(void) const;
+            /// OpÃ©rateur ///
+            DoubleArray operator ()(const DoubleArray dinput);
+
+            /// Destructeur ///
+            virtual ~CFunctor(void);
+
+            //Traitement ///
+            virtual void final(void);
+
+         protected :
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput) = 0;
+
+            /// Autres ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+            /// Constructeurs ///
+            CFunctor(void);                             // Not implemented.
+            CFunctor(const StdString & id, DoubleArray doutput);
+            CFunctor(const CFunctor & functor);         // Not implemented.
+            CFunctor(const CFunctor * const functor);   // Not implemented.
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            DoubleArray doutput;
+            
+         protected :
+            /// PropriÃ©tÃ©s protÃ©gÃ©es ///   
+            int nbcall;            
+      }; // class CFunctor
+   } // namespace func
+} // namespace xmlioserver
+
+#include "functor_type.hpp"
+
+#endif // __XMLIO_CFunctor__
Index: /XIOS/trunk/src/functor/average.cpp
===================================================================
--- /XIOS/trunk/src/functor/average.cpp	(revision 306)
+++ /XIOS/trunk/src/functor/average.cpp	(revision 306)
@@ -0,0 +1,37 @@
+#include "average.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CAverage::CAverage(DoubleArray doutput)
+         : SuperClass(StdString("average"), doutput)
+      { /* Ne rien faire de plus */ }
+
+      CAverage::~CAverage(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CAverage::apply(const DoubleArray _dinput,
+                                 DoubleArray _doutput)
+      {
+         const double * it1  = _dinput->data(),
+                      * end1 = _dinput->data() + _dinput->num_elements(); 
+               double * it   = _doutput->data();
+         if (this->nbcall == 1)
+              for (; it1 != end1; it1++, it++) *it  = *it1;
+         else for (; it1 != end1; it1++, it++) *it += *it1;               
+      }
+      
+      void CAverage::final(void)
+      {
+          double * it1  = this->getDataOutput()->data(),
+                 * end1 = this->getDataOutput()->data() + this->getDataOutput()->num_elements();
+          for (; it1 != end1; it1++) *it1 /= this->nbcall;
+          this->nbcall = 0;                                                   
+      }
+   } // namespace func
+} // namespace xmlioserver
Index: /XIOS/trunk/src/functor/average.hpp
===================================================================
--- /XIOS/trunk/src/functor/average.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/average.hpp	(revision 306)
@@ -0,0 +1,39 @@
+#ifndef __XMLIO_CAverage__
+#define __XMLIO_CAverage__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAverage : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            //CAverage(void);                             // Not implemented.
+            //CAverage(const CFunData & data);
+            CAverage(DoubleArray doutput);
+            //CAverage(const CAverage & average);         // Not implemented.
+            //CAverage(const CAverage * const average);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void final(void) ;
+            
+            /// Destructeur ///
+            virtual ~CAverage(void);
+
+      }; // class CAverage
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CAverage__
Index: /XIOS/trunk/src/functor/functor_type.hpp
===================================================================
--- /XIOS/trunk/src/functor/functor_type.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/functor_type.hpp	(revision 306)
@@ -0,0 +1,11 @@
+#ifndef __XMLIO_functor_type__
+#define __XMLIO_functor_type__
+
+#include "average.hpp"
+#include "instant.hpp"
+#include "once.hpp"
+#include "maximum.hpp"
+#include "minimum.hpp"
+
+#endif //__XMLIO_functor_type__
+
Index: /XIOS/trunk/src/functor/instant.cpp
===================================================================
--- /XIOS/trunk/src/functor/instant.cpp	(revision 306)
+++ /XIOS/trunk/src/functor/instant.cpp	(revision 306)
@@ -0,0 +1,30 @@
+#include "instant.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CInstant::CInstant(DoubleArray doutput)
+         : SuperClass(StdString("instant"), doutput)
+      { /* Ne rien faire de plus */ }
+
+      CInstant::~CInstant(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CInstant::apply(const DoubleArray _dinput,
+                                 DoubleArray _doutput)
+      {
+       	 const double * it1  = _dinput->data(),
+       	              * end1 = _dinput->data() + _dinput->num_elements();
+       	 double * it   = _doutput->data();
+       	 for (; it1 != end1; it1++, it++) *it  = *it1;
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: /XIOS/trunk/src/functor/instant.hpp
===================================================================
--- /XIOS/trunk/src/functor/instant.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/instant.hpp	(revision 306)
@@ -0,0 +1,38 @@
+#ifndef __XMLIO_CInstant__
+#define __XMLIO_CInstant__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CInstant : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            //CInstant(void);                             // Not implemented.
+            //CInstant(const CFunData & data);
+            CInstant(DoubleArray doutput);
+            //CInstant(const CInstant & instant);         // Not implemented.
+            //CInstant(const CInstant * const instant);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+
+            /// Destructeur ///
+            virtual ~CInstant(void);
+
+      }; // class CInstant
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CInstant__
Index: /XIOS/trunk/src/functor/maximum.cpp
===================================================================
--- /XIOS/trunk/src/functor/maximum.cpp	(revision 306)
+++ /XIOS/trunk/src/functor/maximum.cpp	(revision 306)
@@ -0,0 +1,40 @@
+#include "maximum.hpp"
+#include <algorithm>
+
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CMaximum::CMaximum(DoubleArray doutput)
+         : SuperClass(StdString("maximum"), doutput)
+      { /* Ne rien faire de plus */ }
+
+      CMaximum::~CMaximum(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CMaximum::apply(const DoubleArray _dinput,
+                                 DoubleArray _doutput)
+      {
+       	 const double * it1  = _dinput->data(),
+       	              * end1 = _dinput->data() + _dinput->num_elements();
+       	       double * it   = _doutput->data();
+         if (this->nbcall == 1)
+              for (; it1 != end1; it1++, it++) *it = *it1;
+         else for (; it1 != end1; it1++, it++) *it = std::max(*it1, *it);
+
+         it1  = _dinput->data(),
+         end1 = _dinput->data() + _dinput->num_elements();
+       	 it  = _doutput->data();
+         double sum=0 ;
+         for (; it1 != end1; it1++, it++) sum+=*it;
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: /XIOS/trunk/src/functor/maximum.hpp
===================================================================
--- /XIOS/trunk/src/functor/maximum.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/maximum.hpp	(revision 306)
@@ -0,0 +1,38 @@
+#ifndef __XMLIO_CMaximum__
+#define __XMLIO_CMaximum__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CMaximum : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            //CMaximum(void);                             // Not implemented.
+            //CMaximum(const CFunData & data);
+            CMaximum(DoubleArray doutput);
+            //CMaximum(const CMaximum & Maximum);         // Not implemented.
+            //CMaximum(const CMaximum * const Maximum);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+
+            /// Destructeur ///
+            virtual ~CMaximum(void);
+
+      }; // class CMaximum
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CMaximum__
Index: /XIOS/trunk/src/functor/minimum.cpp
===================================================================
--- /XIOS/trunk/src/functor/minimum.cpp	(revision 306)
+++ /XIOS/trunk/src/functor/minimum.cpp	(revision 306)
@@ -0,0 +1,32 @@
+#include "minimum.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CMinimum::CMinimum(DoubleArray doutput)
+         : SuperClass(StdString("minimum"), doutput)
+      { /* Ne rien faire de plus */ }
+
+      CMinimum::~CMinimum(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CMinimum::apply(const DoubleArray _dinput,
+                                 DoubleArray _doutput)
+      {
+         const double * it1  = _dinput->data(),
+                      * end1 = _dinput->data() + _dinput->num_elements();
+         double * it   = _doutput->data();
+         if (this->nbcall == 1)
+              for (; it1 != end1; it1++, it++) *it = *it1;
+         else for (; it1 != end1; it1++, it++) *it = std::min(*it1, *it);
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: /XIOS/trunk/src/functor/minimum.hpp
===================================================================
--- /XIOS/trunk/src/functor/minimum.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/minimum.hpp	(revision 306)
@@ -0,0 +1,38 @@
+#ifndef __XMLIO_CMinimum__
+#define __XMLIO_CMinimum__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CMinimum : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            //CMinimum(void);                             // Not implemented.
+            //CMinimum(const CFunData & data);
+            CMinimum(DoubleArray doutput);
+            //CMinimum(const CMinimum & Minimum);         // Not implemented.
+            //CMinimum(const CMinimum * const Minimum);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+
+            /// Destructeur ///
+            virtual ~CMinimum(void);
+
+      }; // class CMinimum
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CMinimum__
Index: /XIOS/trunk/src/functor/once.cpp
===================================================================
--- /XIOS/trunk/src/functor/once.cpp	(revision 306)
+++ /XIOS/trunk/src/functor/once.cpp	(revision 306)
@@ -0,0 +1,31 @@
+#include "once.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      COnce::COnce(DoubleArray doutput)
+         : SuperClass(StdString("once"), doutput)
+      { /* Ne rien faire de plus */ }
+
+      COnce::~COnce(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void COnce::apply(const DoubleArray _dinput,
+                              DoubleArray _doutput)
+      {
+       	 const double * it1  = _dinput->data(),
+       	              * end1 = _dinput->data() + _dinput->num_elements();
+       	       double * it   = _doutput->data();
+        for (; it1 != end1; it1++, it++) *it  = *it1;
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/functor/once.hpp
===================================================================
--- /XIOS/trunk/src/functor/once.hpp	(revision 306)
+++ /XIOS/trunk/src/functor/once.hpp	(revision 306)
@@ -0,0 +1,38 @@
+#ifndef __XMLIO_COnce__
+#define __XMLIO_COnce__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class COnce : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            //COnce(void);                       // Not implemented.
+            COnce(DoubleArray doutput);
+            //COnce(const COnce & once);         // Not implemented.
+            //COnce(const COnce * const once);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+
+            /// Destructeur ///
+            virtual ~COnce(void);
+
+      }; // class COnce
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_COnce__
+
Index: /XIOS/trunk/src/group_factory.cpp
===================================================================
--- /XIOS/trunk/src/group_factory.cpp	(revision 306)
+++ /XIOS/trunk/src/group_factory.cpp	(revision 306)
@@ -0,0 +1,18 @@
+#include "group_factory.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   StdString CGroupFactory::CurrContext("");
+
+   void CGroupFactory::SetCurrentContextId(const StdString & context)
+   { 
+      CGroupFactory::CurrContext = context;
+   }
+
+   StdString & CGroupFactory::GetCurrentContextId(void)
+   { 
+      return (CGroupFactory::CurrContext);
+   }
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/group_factory.hpp
===================================================================
--- /XIOS/trunk/src/group_factory.hpp	(revision 306)
+++ /XIOS/trunk/src/group_factory.hpp	(revision 306)
@@ -0,0 +1,79 @@
+#ifndef __XMLIO_CGroupFactory__
+#define __XMLIO_CGroupFactory__
+
+/// boost headers ///
+#include <boost/shared_ptr.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "object_factory.hpp"
+#include "group_template.hpp"
+#include "xml_parser.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CGroupFactory
+   {
+      public :
+
+         /// Mutateurs ///
+         static void SetCurrentContextId(const StdString & context);
+
+         template <typename U>
+            static inline void AddGroup(boost::shared_ptr<U> pgroup,
+                                        boost::shared_ptr<U> cgroup);
+
+         template <typename U>
+            static inline void AddChild(boost::shared_ptr<U> group,
+                                        boost::shared_ptr<typename U::RelChild> child);
+
+         /// Accesseurs ///
+         static StdString & GetCurrentContextId(void);
+
+         template <typename U>
+            static inline boost::shared_ptr<U>
+               GetGroup(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline boost::shared_ptr<typename U::RelChild>
+               GetChild(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline int GetGroupNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetGroupIdNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetChildNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetChildIdNum(boost::shared_ptr<U> group);
+
+         /// Tests ///
+         template <typename U>
+            static inline bool HasGroup(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline bool HasChild(boost::shared_ptr<U> group, const StdString & id);
+
+         /// Instanciateur ///
+         template <typename U>
+            static inline boost::shared_ptr<U>
+               CreateGroup(boost::shared_ptr<U> group, const StdString & id = StdString(""));
+
+         template <typename U>
+            static inline boost::shared_ptr<typename U::RelChild>
+               CreateChild(boost::shared_ptr<U> group, const StdString & id = StdString(""));
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static StdString CurrContext;
+
+   }; // class CGroupFactory
+} // namespace xmlioserver
+
+#include "group_factory_impl.hpp"
+#include "group_parser.hpp"
+
+#endif // __XMLIO_CGroupFactory__
Index: /XIOS/trunk/src/group_factory_impl.hpp
===================================================================
--- /XIOS/trunk/src/group_factory_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/group_factory_impl.hpp	(revision 306)
@@ -0,0 +1,138 @@
+#ifndef __XMLIO_CGroupFactory_impl__
+#define __XMLIO_CGroupFactory_impl__
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <typename U>
+      void CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup,
+                                   boost::shared_ptr<U> cgroup)
+   {
+      if (cgroup.get() == NULL || pgroup.get() == NULL )
+         ERROR("CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",
+               << " pgroup or cgroup NULL !");
+      if (!cgroup->hasId())
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
+      else
+      {
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
+         pgroup->groupMap.insert(std::make_pair(cgroup->getId(), cgroup));
+      }
+   }
+
+   template <typename U>
+      void CGroupFactory::AddChild(boost::shared_ptr<U> group,
+                                   boost::shared_ptr<typename U::RelChild> child)
+   {
+      if (group.get() == NULL || child.get() == NULL )
+         ERROR("CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",
+               << " pgroup or cgroup NULL !");
+      if (!child->hasId())
+         group->childList.insert(group->childList.end(), child);
+      else
+      {
+         group->childList.insert(group->childList.end(), child);
+         group->childMap.insert(std::make_pair(child->getId(), child));
+      }
+   }
+
+   template <typename U>
+      boost::shared_ptr<U>
+         CGroupFactory::CreateGroup(boost::shared_ptr<U> group, const StdString & id)
+   {
+      CObjectFactory::SetCurrentContextId
+      (CGroupFactory::GetCurrentContextId());
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>(CObjectFactory::GenUId<U>());
+         group->groupList.insert(group->groupList.end(), value);
+         group->groupMap.insert(std::make_pair(value->getId(), value));
+         return (value);
+      }
+      else if (CGroupFactory::HasGroup(group, id))
+         return (CGroupFactory::GetGroup(group, id));
+      else
+      {
+         boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>(id);
+         group->groupList.insert(group->groupList.end(), value);
+         group->groupMap.insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      boost::shared_ptr<typename U::RelChild>
+         CGroupFactory::CreateChild(boost::shared_ptr<U> group, const StdString & id)
+   {
+      CObjectFactory::SetCurrentContextId
+      (CGroupFactory::GetCurrentContextId());
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<typename U::RelChild> value =
+               CObjectFactory::CreateObject<typename U::RelChild>();
+         group->childList.insert(group->childList.end(), value);
+         group->childMap.insert(std::make_pair(value->getId(), value));
+         return (value);
+      }
+      else if (CGroupFactory::HasChild(group, id))
+         return (CGroupFactory::GetChild(group, id));
+      else
+      {
+         boost::shared_ptr<typename U::RelChild> value =
+               CObjectFactory::CreateObject<typename U::RelChild>(id);
+         group->childList.insert(group->childList.end(), value);
+         group->childMap.insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      bool CGroupFactory::HasGroup(boost::shared_ptr<U> group, const StdString & id)
+   {  return (group->groupMap.find(id) != group->groupMap.end()); }
+
+   template <typename U>
+      bool CGroupFactory::HasChild(boost::shared_ptr<U> group, const StdString & id)
+   {  return (group->childMap.find(id) != group->childMap.end()); }
+
+   template <typename U>
+      int CGroupFactory::GetGroupNum(boost::shared_ptr<U> group)
+   { return (group->groupList.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetGroupIdNum(boost::shared_ptr<U> group)
+   { return (group->groupMap.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetChildNum(boost::shared_ptr<U> group)
+   { return (group->childList.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetChildIdNum(boost::shared_ptr<U> group)
+   { return (group->childMap.size()); }
+
+   template <typename U>
+      boost::shared_ptr<U>
+         CGroupFactory::GetGroup(boost::shared_ptr<U> group, const StdString & id)
+   {
+      if (!CGroupFactory::HasGroup<U>(group, id))
+         ERROR("CGroupFactory::GetGroup(boost::shared_ptr<U> group, const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " group is not referenced !");
+      return (group->groupMap[id]);
+   }
+
+   template <typename U>
+      boost::shared_ptr<typename U::RelChild>
+         CGroupFactory::GetChild(boost::shared_ptr<U> group, const StdString & id)
+   {
+      if (!CGroupFactory::HasChild<U>(group, id))
+         ERROR("CGroupFactory::GetChild(boost::shared_ptr<U> group, const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " child is not referenced !");
+      return (group->childMap[id]);
+   }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGroupFactory_impl__
Index: /XIOS/trunk/src/group_parser.hpp
===================================================================
--- /XIOS/trunk/src/group_parser.hpp	(revision 306)
+++ /XIOS/trunk/src/group_parser.hpp	(revision 306)
@@ -0,0 +1,82 @@
+#ifndef __XMLIO_GroupParser__
+#define __XMLIO_GroupParser__
+
+/// boost headers ///
+#include <boost/cast.hpp>
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)
+   {
+
+      StdString name = node.getElementName();
+      xml::THashAttributes attributes = node.getAttributes();
+      if (withAttr)
+      {
+         CGroupTemplate<U, V, W>::SuperClass::parse(node);
+         if (attributes.end() != attributes.find("src"))
+         {
+            StdIFStream ifs ( attributes["src"].c_str() , StdIFStream::in );
+            if (!ifs.good())
+               ERROR("CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)",
+                     << "[ filename = " << attributes["src"] << " ] Bad xml stream !");
+            xml::CXMLParser::ParseInclude(ifs, *this);
+         }
+      }
+
+      // PARSING POUR GESTION DES ENFANTS
+      boost::shared_ptr<V> group_ptr = (this->hasId())
+         ? CObjectFactory::GetObject<V>(this->getId())
+         : CObjectFactory::GetObject(boost::polymorphic_downcast<V*>(this));
+
+      if (!(node.goToChildElement()))
+      {
+         if (this->hasId())
+         {
+            DEBUG(<< "L'objet de type \'" << V::GetName()
+                  << "\' nommÃ© \'" << this->getId()
+                  << "\' ne contient pas d\'enfant !");
+         }
+      }
+      else
+      {
+         do { // Parcours pour traitement.
+
+            StdString name = node.getElementName();
+            attributes.clear();
+            attributes = node.getAttributes();
+
+            if (name.compare(V::GetName()) == 0)
+            {
+               if (attributes.end() == attributes.find("id"))
+                  CGroupFactory::CreateGroup(group_ptr)->parse(node);
+               else
+                  CGroupFactory::CreateGroup(group_ptr, attributes["id"])->parse(node);
+               continue;
+            }
+
+            if (name.compare(U::GetName()) == 0)
+            {
+               if (attributes.end() == attributes.find("id"))
+                  CGroupFactory::CreateChild(group_ptr)->parse(node);
+               else
+                  CGroupFactory::CreateChild(group_ptr, attributes["id"])->parse(node);
+               continue;
+            }
+
+            DEBUG(<< "Dans le contexte \'" << CObjectFactory::GetCurrentContextId()
+                  << "\', un objet de type \'" << V::GetName()
+                  << "\' ne peut contenir qu'un objet de type \'" << V::GetName()
+                  << "\' ou de type \'" << U::GetName()
+                  << "\' (reÃ§u : " << name << ") !");
+
+         } while (node.goToNextElement());
+         node.goToParentElement(); // Retour au parent
+      }
+   }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_GroupParser__
Index: /XIOS/trunk/src/group_template.hpp
===================================================================
--- /XIOS/trunk/src/group_template.hpp	(revision 306)
+++ /XIOS/trunk/src/group_template.hpp	(revision 306)
@@ -0,0 +1,106 @@
+#ifndef __XMLIO_CGroupTemplate__
+#define __XMLIO_CGroupTemplate__
+
+#include "xmlioserver_spl.hpp"
+#include "declare_attribute.hpp"
+#include "event_server.hpp"
+#include "object_template.hpp"
+
+namespace xmlioserver
+{
+   using namespace tree;
+
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <class U, class V, class W>
+      class CGroupTemplate
+         : public CObjectTemplate<V>, public virtual W
+   {
+         /// Friend ///
+         friend class CGroupFactory;
+
+         /// Typedef ///
+         typedef U Child;
+         typedef V Derived, Group;
+         typedef W SuperClassAttribute;
+         typedef CObjectTemplate<V> SuperClass;
+
+      public :
+      
+         enum EEventId
+         {
+           EVENT_ID_CREATE_CHILD=200, EVENT_ID_CREATE_CHILD_GROUP
+         } ;
+
+         /// SpÃ©cifique ///
+         DECLARE_ATTRIBUTE(StdString, group_ref)
+
+         /// Accesseurs ///
+         const xios_map<StdString,
+                           boost::shared_ptr<Group> >& getGroupMap(void) const;
+         const std::vector<boost::shared_ptr<Child> >& getChildList(void) const;
+
+         void getAllChildren(std::vector<boost::shared_ptr<Child> > & allc) const;
+         std::vector<boost::shared_ptr<Child> > getAllChildren(void) const;
+
+         /// Autres ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+         
+         virtual void toBinary  (StdOStream & os) const;
+         virtual void fromBinary(StdIStream & is);
+
+         virtual void parse(xml::CXMLNode & node);
+         virtual void parse(xml::CXMLNode & node, bool withAttr);
+         
+         /// Test ///
+         virtual bool hasChild(void) const;
+
+         /// Accesseurs statiques ///
+         static inline StdString GetName(void);
+         static inline StdString GetDefName(void);
+
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+         void solveRefInheritance(void);
+//         static bool has(const string & id); 
+//         static boost::shared_ptr<V> get(const string& id) ;
+//         static boost::shared_ptr<V> create(const string& id=string("")) ;
+         boost::shared_ptr<U> createChild(const string& id="") ; 
+         boost::shared_ptr<V> createChildGroup(const string& id="") ; 
+         static bool dispatchEvent(CEventServer& event) ;
+         void sendCreateChild(const string& id="") ;
+         void sendCreateChildGroup(const string& id="") ;
+         static void recvCreateChild(CEventServer& event) ;
+         void recvCreateChild(CBufferIn& buffer) ;
+         static void recvCreateChildGroup(CEventServer& event) ;
+         void recvCreateChildGroup(CBufferIn& buffer) ;
+         
+         /// Destructeur ///
+         virtual ~CGroupTemplate(void);
+
+      protected :
+
+         /// Constructeurs ///
+         CGroupTemplate(void);
+         CGroupTemplate(const StdString & id);
+         CGroupTemplate(const CGroupTemplate<U, V, W> & group,
+                        bool withAttrList = true, bool withId = true); // Not implemented yet.
+         CGroupTemplate(const CGroupTemplate<U, V, W> * const group);  // Not implemented yet.
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         xios_map<StdString,
+                     boost::shared_ptr<Child> > childMap;
+         std::vector<boost::shared_ptr<Child> > childList;
+
+         xios_map<StdString,
+                     boost::shared_ptr<Group> > groupMap;
+         std::vector<boost::shared_ptr<Group> > groupList;
+
+   }; // class CGroupTemplate
+} // namespace xmlioserver
+
+//#include "group_template_impl.hpp"
+
+#endif // __XMLIO_CGroupTemplate__
Index: /XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/group_template_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/group_template_impl.hpp	(revision 306)
@@ -0,0 +1,468 @@
+#ifndef __XMLIO_CGroupTemplate_impl__
+#define __XMLIO_CGroupTemplate_impl__
+
+#include "xmlioserver_spl.hpp"
+#include "event_server.hpp"
+#include "object_template_impl.hpp"
+#include "group_template.hpp"
+#include "context.hpp"
+#include "event_client.hpp"
+#include "context_client.hpp"
+
+
+namespace xmlioserver
+{
+   using namespace tree;
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::CGroupTemplate(void)
+         : CObjectTemplate<V>() //, V()
+         , childMap(), childList()
+         , groupMap(), groupList()
+   { /* Ne rien faire de plus */ }
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::CGroupTemplate(const StdString & id)
+         : CObjectTemplate<V>(id) //, V()
+         , childMap(), childList()
+         , groupMap(), groupList()
+   { /* Ne rien faire de plus */ }
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::~CGroupTemplate(void)
+   { /* Ne rien faire de plus */ }
+   
+   ///--------------------------------------------------------------
+   
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::toBinary(StdOStream & os) const
+   {
+      SuperClass::toBinary(os);
+      
+      const StdSize grpnb = this->groupList.size();
+      const StdSize chdnb = this->childList.size();
+      tree::ENodeType cenum = U::GetType();
+      tree::ENodeType genum = V::GetType();
+      
+      os.write (reinterpret_cast<const char*>(&grpnb) , sizeof(StdSize));
+      os.write (reinterpret_cast<const char*>(&chdnb) , sizeof(StdSize));      
+      
+      typename std::vector<boost::shared_ptr<V> >::const_iterator 
+         itg = this->groupList.begin(), endg = this->groupList.end();
+      typename std::vector<boost::shared_ptr<U> >::const_iterator 
+         itc = this->childList.begin(), endc = this->childList.end();
+            
+      for (; itg != endg; itg++)
+      { 
+         boost::shared_ptr<V> group = *itg;
+         bool hid = group->hasId();
+         
+         os.write (reinterpret_cast<const char*>(&genum), sizeof(tree::ENodeType));      
+         os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+         
+         if (hid)
+         {
+            const StdString & id = group->getId();
+            const StdSize size   = id.size();
+               
+            os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize));
+            os.write (id.data(), size * sizeof(char));         
+         }              
+         group->toBinary(os);
+      }
+            
+      for (; itc != endc; itc++)
+      { 
+         boost::shared_ptr<U> child = *itc;
+         bool hid = child->hasId();
+         
+         os.write (reinterpret_cast<const char*>(&cenum), sizeof(tree::ENodeType));
+         os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+         
+         if (hid)
+         {
+            const StdString & id = child->getId();
+            const StdSize size   = id.size();
+               
+            os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize));
+            os.write (id.data(), size * sizeof(char));         
+         }         
+         child->toBinary(os);
+      }
+      
+   }
+   
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::fromBinary(StdIStream & is)
+   {
+      SuperClass::fromBinary(is);
+      
+      boost::shared_ptr<V> group_ptr = (this->hasId())
+         ? CObjectFactory::GetObject<V>(this->getId())
+         : CObjectFactory::GetObject(boost::polymorphic_downcast<V*>(this));
+      
+      StdSize grpnb = 0;
+      StdSize chdnb = 0;
+      tree::ENodeType renum = Unknown;
+      
+      is.read (reinterpret_cast<char*>(&grpnb), sizeof(StdSize));
+      is.read (reinterpret_cast<char*>(&chdnb), sizeof(StdSize));
+      
+      for (StdSize i = 0; i < grpnb; i++)
+      {
+         bool hid = false;
+         is.read (reinterpret_cast<char*>(&renum), sizeof(tree::ENodeType));
+         is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+         
+         if (renum != V::GetType())
+            ERROR("CGroupTemplate<U, V, W>::fromBinary(StdIStream & is)",
+                  << "[ renum = " << renum << "] Bad type !");
+                        
+         if (hid)
+         {
+            StdSize size  = 0;
+            is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+            StdString id(size, ' ');
+            is.read (const_cast<char *>(id.data()), size * sizeof(char));
+            CGroupFactory::CreateGroup(group_ptr, id)->fromBinary(is);
+         }
+         else
+         {
+            CGroupFactory::CreateGroup(group_ptr)->fromBinary(is);
+         }
+      }
+      
+      for (StdSize j = 0; j < chdnb; j++)
+      {
+         bool hid = false;
+         is.read (reinterpret_cast<char*>(&renum), sizeof(tree::ENodeType));
+         is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+         
+         if (renum != U::GetType())
+            ERROR("CGroupTemplate<U, V, W>::fromBinary(StdIStream & is)",
+                  << "[ renum = " << renum << "] Bad type !");
+                  
+         if (hid)
+         {
+            StdSize size  = 0;
+            is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+            StdString id(size, ' ');
+            is.read (const_cast<char *>(id.data()), size * sizeof(char));
+            CGroupFactory::CreateChild(group_ptr, id)->fromBinary(is);            
+         }
+         else
+         {
+            CGroupFactory::CreateChild(group_ptr)->fromBinary(is);
+         }   
+      }
+   }
+
+   //--------------------------------------------------------------
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::toString(void) const
+   {
+      StdOStringStream oss;
+      StdString name = (this->getId().compare(V::GetDefName()) != 0)
+                     ? V::GetName() : V::GetDefName();
+
+      oss << "<" << name << " ";
+      if (this->hasId() && (this->getId().compare(V::GetDefName()) != 0))
+         oss << " id=\"" << this->getId() << "\" ";
+         
+      if (this->hasChild())
+      {
+         oss << SuperClassAttribute::toString() << ">" << std::endl;
+         
+         typename std::vector<boost::shared_ptr<V> >::const_iterator 
+            itg = this->groupList.begin(), endg = this->groupList.end();
+         typename std::vector<boost::shared_ptr<U> >::const_iterator 
+            itc = this->childList.begin(), endc = this->childList.end();
+            
+         for (; itg != endg; itg++)
+         { 
+            boost::shared_ptr<V> group = *itg;
+            oss << *group << std::endl;
+         }
+            
+         for (; itc != endc; itc++)
+         { 
+            boost::shared_ptr<U> child = *itc;
+            oss << *child << std::endl;
+         }
+            
+         oss << "</" << name << " >";
+      }
+      else
+      {
+         oss << SuperClassAttribute::toString() << "/>";
+      }
+      return (oss.str());
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::fromString(const StdString & str)
+   { 
+      ERROR("CGroupTemplate<U, V, W>::toString(void)",
+            << "[ str = " << str << "] Not implemented yet !");
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::GetName(void)
+   { 
+      return (U::GetName().append("_group")); 
+   }
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::GetDefName(void)
+   { 
+      return (U::GetName().append("_definition")); 
+   }
+   
+   //---------------------------------------------------------------   
+
+   template <class U, class V, class W>
+      const std::vector<boost::shared_ptr<U> >&
+         CGroupTemplate<U, V, W>::getChildList(void) const
+   { 
+      return (this->childList); 
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      const xios_map<StdString, boost::shared_ptr<V> >&
+         CGroupTemplate<U, V, W>::getGroupMap(void) const
+   { 
+      return (this->groupList);
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      bool CGroupTemplate<U, V, W>::hasChild(void) const
+   { 
+      return ((groupList.size() + childList.size()) > 0); 
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node)
+   { 
+      this->parse(node, true); 
+   }
+   
+   //---------------------------------------------------------------
+   
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::solveDescInheritance(const CAttributeMap * const parent)
+   {
+      if (parent != NULL)
+         SuperClassAttribute::setAttributes(parent);
+         
+      typename std::vector<boost::shared_ptr<U> >::const_iterator 
+         itc = this->childList.begin(), endc = this->childList.end();
+      typename std::vector<boost::shared_ptr<V> >::const_iterator 
+         itg = this->groupList.begin(), endg = this->groupList.end();
+             
+      for (; itc != endc; itc++)
+      { 
+         boost::shared_ptr<U> child = *itc;
+         child->solveDescInheritance(this);
+      }
+            
+      for (; itg != endg; itg++)
+      { 
+         boost::shared_ptr<V> group = *itg;
+         group->solveRefInheritance();
+         group->solveDescInheritance(this);
+      }
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::getAllChildren(std::vector<boost::shared_ptr<U> > & allc) const
+   {
+      allc.insert (allc.end(), childList.begin(), childList.end());
+      typename std::vector<boost::shared_ptr<V> >::const_iterator 
+         itg = this->groupList.begin(), endg = this->groupList.end();
+         
+      for (; itg != endg; itg++)
+      { 
+         boost::shared_ptr<V> group = *itg;
+         group->getAllChildren(allc);
+      }
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      std::vector<boost::shared_ptr<U> > CGroupTemplate<U, V, W>::getAllChildren(void) const
+   { 
+      std::vector<boost::shared_ptr<U> > allc;
+      this->getAllChildren(allc);
+      return (allc);
+   }
+
+   //---------------------------------------------------------------
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::solveRefInheritance(void)
+   { /* Ne rien faire de plus */ }
+   
+//   template <class U, class V, class W>
+//   bool CGroupTemplate<U, V, W>::has(const string& id) 
+//   {
+//       return CObjectFactory::HasObject<V>(id) ;
+//   }
+
+//   template <class U, class V, class W>
+//   boost::shared_ptr<V> CGroupTemplate<U, V, W>::get(const string& id) 
+//   {
+//       return CObjectFactory::GetObject<V>(id) ;
+//   }
+
+//   template <class U, class V, class W>
+//   boost::shared_ptr<V> CGroupTemplate<U, V, W>::get() 
+//   {
+//       return CObjectFactory::GetObject<V>(this) ;
+//   }
+   
+//   template <class U, class V, class W>
+//   boost::shared_ptr<V> CGroupTemplate<U, V, W>::create(const string& id) 
+//   {
+//       return CObjectFactory::CreateObject<V>(id) ;
+//   }
+   ///--------------------------------------------------------------
+
+   template <class U, class V, class W>
+   boost::shared_ptr<U> CGroupTemplate<U, V, W>::createChild(const string& id) 
+  {
+    return CGroupFactory::CreateChild<V>(this->get(), id) ;
+  }
+  
+   template <class U, class V, class W>
+   boost::shared_ptr<V> CGroupTemplate<U, V, W>::createChildGroup(const string& id) 
+  {
+    return CGroupFactory::CreateGroup<V>(this->get(), id) ;
+  }
+
+
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id)
+   {
+    shared_ptr<CContext> context=CContext::current() ;
+    
+    if (! context->hasServer )
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<id ;
+         event.push(client->getServerLeader(),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)
+   {
+    shared_ptr<CContext> context=CContext::current() ;
+    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 ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      V::get(id)->recvCreateChild(*buffer) ;
+   }
+   
+   
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::recvCreateChild(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      createChild(id) ;
+   }
+
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::recvCreateChildGroup(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      V::get(id)->recvCreateChildGroup(*buffer) ;
+   }
+   
+   
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::recvCreateChildGroup(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      createChildGroup(id) ;
+   }
+   
+
+   template <class U, class V, class W>
+   bool CGroupTemplate<U, V, W>::dispatchEvent(CEventServer& event)
+   {
+      if (CObjectTemplate<V>::dispatchEvent(event)) return true ;
+      else
+      {
+        switch(event.type)
+        {
+           case EVENT_ID_CREATE_CHILD :
+             recvCreateChild(event) ;
+             return true ;
+             break ;
+         
+           case EVENT_ID_CREATE_CHILD_GROUP :
+             recvCreateChildGroup(event) ;
+             return true ;
+             break ;       
+         
+           default :
+           return false ;
+        }
+      }
+   }
+
+} // namespace xmlioserver
+
+
+#endif // __XMLIO_CGroupTemplate_impl__
Index: /XIOS/trunk/src/indent.cpp
===================================================================
--- /XIOS/trunk/src/indent.cpp	(revision 306)
+++ /XIOS/trunk/src/indent.cpp	(revision 306)
@@ -0,0 +1,53 @@
+#include "indent.hpp"
+
+/// boost headers ///
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/split.hpp>
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   unsigned int CIndent::Indent   = 0;
+   StdString    CIndent::Increm   = StdString("   ");
+   bool         CIndent::WithLine = false;
+
+   StdOStream & CIndent::NIndent(StdOStream& out)
+   {
+      static unsigned int LineNB = 1;
+      if (CIndent::WithLine) out << LineNB++ << ". ";
+      for(unsigned int i = 0; i < CIndent::Indent; out << CIndent::Increm , i++){}
+      return (out);
+   }
+
+   StdOStream & CIndent::IncIndent(StdOStream& out)
+   { CIndent::Indent++; return (CIndent::NIndent(out)); }
+
+   StdOStream & CIndent::DecEndl  (StdOStream& out)
+   { CIndent::Indent--; return (out); }
+
+   ///----------------------------------------
+
+   StdString CIndentedXml::Indented(const StdString & content)
+   {
+      StdOStringStream retvalue;
+      std::vector<StdString> str;
+      boost::split(str, content, boost::is_any_of("\n"));
+      
+      std::vector<StdString>::iterator it = str.begin(), end = str.end();
+      
+      for (; it != end; it++)
+      {
+         StdString & line = *it;
+         if (line.find("<? ") != StdString::npos ||
+             line.find(xml::CXMLNode::GetRootName()) != StdString::npos)
+            retvalue << CIndent::NIndent << line <<  std::endl;
+         else if (line.find("</") != StdString::npos)
+            retvalue << CIndent::NIndent   << line << CIndent::DecEndl << std::endl;
+         else if (line.find(" />") != StdString::npos)
+            retvalue << CIndent::IncIndent << line << CIndent::DecEndl << std::endl;
+         else
+            retvalue << CIndent::IncIndent << line <<  std::endl;
+      }
+      return (retvalue.str());
+   }
+} // namespace xmlioserver
Index: /XIOS/trunk/src/indent.hpp
===================================================================
--- /XIOS/trunk/src/indent.hpp	(revision 306)
+++ /XIOS/trunk/src/indent.hpp	(revision 306)
@@ -0,0 +1,50 @@
+#ifndef __XMLIO_CIndent__
+#define __XMLIO_CIndent__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CIndent
+   {
+      public :
+
+         /// MÃ©thodes statiques ///
+         static StdOStream & NIndent  (StdOStream & out);
+         static StdOStream & IncIndent(StdOStream & out);
+         static StdOStream & DecEndl  (StdOStream & out);
+
+      private :
+
+         /// PropriÃ©tÃ©s  statiques ///
+         static unsigned int Indent;
+         static StdString    Increm;
+         static bool         WithLine;
+
+   }; // class CIndent
+
+    ///--------------------------------------------------------------
+    
+   class CIndentedXml
+   {
+      public :
+
+         /// MÃ©thode statique ///
+         static StdString Indented(const StdString & content);
+
+   }; // class CIndentedXml
+
+    ///--------------------------------------------------------------
+
+} // namespace xmlioserver
+
+   /// ////////////////////// Macros ////////////////////// ///
+   
+#define NIndent   CIndent::NIndent
+#define IncIndent CIndent::IncIndent
+#define DecEndl   CIndent::DecEndl
+
+#endif // __XMLIO_CIndent__
Index: /XIOS/trunk/src/input/inetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/input/inetcdf4.cpp	(revision 306)
+++ /XIOS/trunk/src/input/inetcdf4.cpp	(revision 306)
@@ -0,0 +1,791 @@
+#include "inetcdf4.hpp"
+
+#include <boost/algorithm/string.hpp>
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CINetCDF4::CINetCDF4(const StdString & filename)
+      {
+         CheckError(nc_open(filename.c_str(), NC_NOWRITE, &this->ncidp));
+      }
+
+      CINetCDF4::~CINetCDF4(void)
+      {
+          CheckError(nc_close(this->ncidp));
+      }
+
+      ///--------------------------------------------------------------
+
+      void CINetCDF4::CheckError(int status)
+      {
+         if (status != NC_NOERR)
+         {
+            StdString errormsg (nc_strerror(status)); // fuite mÃ©moire ici ?
+            ERROR("CINetCDF4::CheckError(int status)",
+                  << "[ status = " << status << " ] " << errormsg);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      int CINetCDF4::getGroup(const CVarPath * const path)
+      {
+         int retvalue = this->ncidp;
+         if (path == NULL) return (retvalue);
+         CVarPath::const_iterator it = path->begin(), end = path->end();
+         
+         for (; it != end; it++)
+         {
+            const StdString & groupid = *it;
+            CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
+         }       
+            
+         return (retvalue);
+      }
+
+      int CINetCDF4::getVariable(const StdString & varname,
+                                 const CVarPath * const path)
+      {
+         int varid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_varid (grpid, varname.c_str(), &varid));
+         return (varid);
+      }
+
+      int CINetCDF4::getDimension(const StdString & dimname,
+                                  const CVarPath  * const path)
+      {
+         int dimid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_dimid (grpid, dimname.c_str(), &dimid));
+         return (dimid);
+      }
+
+      std::pair<nc_type, StdSize> CINetCDF4::getAttribute
+                                 (const StdString & attname,
+                                  const StdString * const var,
+                                  const CVarPath  * const path)
+      {
+         std::pair<nc_type, StdSize> retvalue;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         CheckError(nc_inq_att(grpid, varid, attname.c_str(),
+                              &retvalue.first, &retvalue.second));
+         return (retvalue);
+      }
+
+      int CINetCDF4::getUnlimitedDimension(const CVarPath  * const path)
+      {
+         int dimid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_unlimdim (grpid, &dimid));
+         return (dimid);
+      }
+
+      StdString CINetCDF4::getUnlimitedDimensionName(const CVarPath  * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int grpid = this->getGroup(path);
+         int dimid = this->getUnlimitedDimension(path);
+         CheckError(nc_inq_dimname(grpid, dimid, full_name_in));
+
+         StdString dimname(full_name_in);
+         return (dimname);
+      }
+
+      //---------------------------------------------------------------
+      StdSize CINetCDF4::getNbVertex(const StdString & name,
+                                     const CVarPath  * const path)
+      {
+
+         if (this->isRectilinear(name, path) ||
+             this->isCurvilinear(name, path))
+         {
+            if (this->is3Dim(name, path)) return (8);
+            else return (4);
+         }
+         if (this->isUnstructured(name, path))
+         {
+            StdString bound = this->getBoundsId
+                     (this->getCoordinatesIdList(name, path).back(), path);
+            StdString dim = this->getDimensionsList(&bound, path).back();
+            return (this->getDimensions(&bound, path)[dim]);
+         }
+         return ((size_t)(-1));
+      }
+
+      //---------------------------------------------------------------
+
+      std::list<StdString> CINetCDF4::getGroups(const CVarPath * const path)
+      {
+         StdSize strlen = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         int nbgroup = 0, *groupid = NULL;
+         int grpid = this->getGroup(path);
+         std::list<StdString> retvalue;
+
+         CheckError(nc_inq_grps(grpid, &nbgroup, NULL));
+         groupid = new int[nbgroup]();
+         CheckError(nc_inq_grps(grpid, NULL, groupid));
+
+         for (int i = 0; i < nbgroup; i++)
+         {
+            CheckError(nc_inq_grpname_full(groupid[i], &strlen, full_name_in));
+            StdString groupname(full_name_in, strlen);
+            retvalue.push_back(groupname);
+         }
+
+         delete [] groupid;
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getVariables(const CVarPath * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int nbvar = 0, *varid = NULL;
+         int grpid = this->getGroup(path);
+         std::list<StdString> retvalue;
+
+         CheckError(nc_inq_varids(grpid, &nbvar, NULL));
+         varid = new int[nbvar]();
+         CheckError(nc_inq_varids(grpid, NULL, varid));
+
+         for (int i = 0; i < nbvar; i++)
+         {
+            CheckError(nc_inq_varname(grpid, varid[i], full_name_in));
+            StdString varname(full_name_in);
+            retvalue.push_back(varname);
+         }
+
+         delete [] varid;
+         return (retvalue);
+      }
+
+      StdSize CINetCDF4::getNbOfTimestep(const CVarPath * const path)
+      {
+         return (this->getDimensions(NULL, path)[this->getUnlimitedDimensionName(path)]);
+      }
+
+      std::set<StdString> CINetCDF4::getBoundVariables(const CVarPath * const path)
+      {
+         std::set<StdString> retvalue;         
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            if (this->hasBounds(var, path))
+               retvalue.insert(retvalue.end(), this->getBoundsId(var, path));
+         }
+         return (retvalue);
+      }
+
+      std::set<StdString> CINetCDF4::getCoordVariables(const CVarPath * const path)
+      {
+         std::set<StdString> retvalue;
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            std::list<StdString> coords = this->getCoordinatesIdList(var, path);
+            std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+            for (; it != end; it++)
+            {
+               const StdString & coord = *it;
+               if (this->hasVariable(coord, path))
+                  retvalue.insert(retvalue.end(), coord);
+            }
+         }
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getDimensionsList
+                  (const StdString * const var, const CVarPath  * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int nbdim = 0, *dimid = NULL;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         std::list<StdString> retvalue;
+
+         if (var != NULL)
+         {
+            CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_vardimid(grpid, varid, dimid));
+         }
+         else
+         {
+            CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+         }
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
+            StdString dimname(full_name_in);
+            retvalue.push_back(dimname);
+         }
+         delete [] dimid;
+
+         return (retvalue);
+      }
+
+      std::map<StdString, StdSize> CINetCDF4::getDimensions
+                  (const StdString * const var, const CVarPath  * const path)
+      {
+         StdSize size = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         int nbdim = 0, *dimid = NULL;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         std::map<StdString, StdSize> retvalue;
+
+         if (var != NULL)
+         {
+            CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_vardimid(grpid, varid, dimid));
+         }
+         else
+         {
+            CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+         }
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
+            CheckError(nc_inq_dimlen (grpid, dimid[i], &size));
+
+            StdString dimname(full_name_in);
+            retvalue.insert(retvalue.end(), std::make_pair(dimname, size));
+         }
+         delete [] dimid;
+
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getAttributes
+               (const StdString * const var, const CVarPath  * const path )
+      {
+         int nbatt = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         std::list<StdString> retvalue;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+
+         if (var != NULL)
+            CheckError(nc_inq_varnatts (grpid, varid, &nbatt));
+         else
+            CheckError(nc_inq_natts(grpid, &nbatt));
+
+         for (int i = 0; i < nbatt; i++)
+         {
+            CheckError(nc_inq_attname(grpid, varid, i, full_name_in));
+            StdString attname(full_name_in);
+            retvalue.push_back(attname);
+         }
+         return (retvalue);
+      }
+
+      int CINetCDF4::getAttributeId(const StdString & name,
+                                    const StdString * const var,
+                                    const CVarPath  * const path)
+      {
+         int retvalue = 0;
+         std::list<StdString> atts = this->getAttributes(var, path);
+         std::list<StdString>::const_iterator it = atts.begin(), end = atts.end();
+         for (; it != end; it++)
+         {
+            const StdString & attname = *it;
+            if (attname.compare(name) == 0)
+               return (retvalue);
+            retvalue++;
+         }
+         return (-1);
+      }
+
+      //---------------------------------------------------------------
+
+      bool CINetCDF4::hasMissingValue(const StdString & name,
+                                      const CVarPath  * const path)
+      {
+         return (this->hasAttribute("missing_value", &name, path) ||
+                 this->hasAttribute("_FillValue", &name, path));
+      }
+
+      bool CINetCDF4::hasAttribute(const StdString & name,
+                                   const StdString * const var ,
+                                   const CVarPath  * const path)
+      {
+         std::list<StdString> atts = this->getAttributes(var, path);
+         std::list<StdString>::const_iterator it = atts.begin(), end = atts.end();
+         for (; it != end; it++)
+         {
+            const StdString & attname = *it;
+            if (attname.compare(name) == 0) return (true);
+         }
+         return (false);
+      }
+
+      bool CINetCDF4::hasVariable(const StdString & name,
+                                  const CVarPath  * const path)
+      {
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & varname = *it;
+            if (varname.compare(name) == 0) return (true);
+         }
+         return (false);
+      }
+
+      bool CINetCDF4::hasCoordinates(const StdString & name,
+                                     const CVarPath  * const path)
+      {
+         return (this->hasAttribute("coordinates", &name, path));
+      }
+
+      bool CINetCDF4::hasBounds(const StdString & name,
+                                const CVarPath  * const path)
+      {
+         return (this->hasAttribute("bounds", &name, path));
+      }
+
+      bool CINetCDF4::hasTemporalDim(const CVarPath  * const path)
+      {
+         return (this->getUnlimitedDimension(path) != -1);
+      }
+
+      //---------------------------------------------------------------
+
+#define GET_ATTRIBUTE_VALUE(type, func_ext, type_enum)                     \
+      template <>                                                          \
+         std::vector<type> CINetCDF4::getAttributeValue                    \
+            (const StdString & name, const StdString * const var,          \
+                                     const CVarPath  * const path)         \
+      {                                                                    \
+         int grpid = this->getGroup(path);                                 \
+         int varid = (var != NULL)                                         \
+                   ? this->getVariable(*var, path) : NC_GLOBAL;            \
+         std::pair<nc_type , StdSize> attinfos =                           \
+                     this->getAttribute(name, var, path);                  \
+         std::vector<type> retvalue(attinfos.second);                      \
+         if (attinfos.first != type_enum)                                  \
+            ERROR("CINetCDF4::getAttributeValue<double>(name, var, path",  \
+                  << "[ name : "          << name                          \
+                  << ", type requested :" << attinfos.first                \
+                  << ", type stored : "   << type_enum      << "]"         \
+                  << " Invalid type !");                                   \
+         CheckError(nc_get_att_##func_ext                                  \
+                        (grpid, varid, name.c_str(), &(retvalue[0])));     \
+         return (retvalue);                                                \
+      }
+
+      GET_ATTRIBUTE_VALUE(double, double, NC_DOUBLE)
+      GET_ATTRIBUTE_VALUE(float , float , NC_FLOAT)
+      GET_ATTRIBUTE_VALUE(int   , int   , NC_INT)
+      GET_ATTRIBUTE_VALUE(char  , text  , NC_CHAR)
+
+      template <>
+         StdString CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path)
+      {
+         std::vector<char> chart = this->getAttributeValue
+                        <std::vector<char> >(name, var, path);
+         StdString retvalue(&(chart[0]), chart.size());
+         return (retvalue);
+      }
+
+      template <>
+         int CINetCDF4::getMissingValue(const StdString & name,
+                                        const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<int> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<int> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+
+      template <>
+         double CINetCDF4::getMissingValue(const StdString & name,
+                                           const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<double> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<double> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+
+      template <>
+         float CINetCDF4::getMissingValue(const StdString & name,
+                                          const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<float> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<float> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::list<StdString> CINetCDF4::getCoordinatesIdList
+         (const StdString & name, const CVarPath  * const path)
+      {
+         std::list<StdString> retvalue;
+         StdString value = this->getCoordinatesId(name, path);
+         
+         boost::split(retvalue, value, boost::is_any_of(" "));
+         
+         std::list<StdString>::iterator it = retvalue.begin(), end = retvalue.end();
+         for (; it != end; it++)
+         {
+            StdString & coord = *it;
+            coord.assign(coord.data());
+         }
+         return (retvalue);
+      }
+
+      StdString CINetCDF4::getCoordinatesId
+         (const StdString & name, const CVarPath  * const path)
+      {
+         StdString retvalue;
+         if (this->hasAttribute("coordinates", &name, path))
+         {
+            return (this->getAttributeValue<StdString>("coordinates", &name, path));
+         }
+         else
+         {
+            std::list<StdString> dims = this->getDimensionsList(&name, path);
+            std::list<StdString>::const_iterator it = dims.begin(), end = dims.end();
+            for (; it != end; it++)
+            {
+               const StdString & value = *it;               
+               retvalue.append(value).push_back(' ');
+            }
+            retvalue.erase (retvalue.end()-1) ;
+         }
+
+         return (retvalue);
+      }
+
+      StdString CINetCDF4::getBoundsId(const StdString & name,
+                                       const CVarPath  * const path)
+      {
+         StdString retvalue;
+         if (this->hasAttribute("bounds", &name, path))
+            return (this->getAttributeValue<StdString>("bounds", &name, path));
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      bool CINetCDF4::isBound(const StdString & name,
+                              const CVarPath  * const path)
+      {
+         std::set<StdString> bounds = this->getBoundVariables(path);
+         return (bounds.find(name) != bounds.end());
+      }
+
+      bool CINetCDF4::isCoordinate(const StdString & name,
+                                   const CVarPath  * const path)
+      {
+         std::set<StdString> coords = this->getCoordVariables(path);
+         return (coords.find(name) != coords.end());
+      }
+
+      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();
+         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()))
+                  continue;
+               else
+                  return (false);
+            }
+         }
+         return (true);
+      }
+
+      bool CINetCDF4::isCurvilinear(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isRectilinear(name, path) ||
+            !this->hasCoordinates(name, path))
+            return (false);
+
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
+               if (dimvar.size() != 2) return (false);
+            }
+            else return (false);
+         }
+         return (true);
+      }
+
+      bool CINetCDF4::isUnstructured(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isRectilinear(name, path)    ||
+             this->isCurvilinear(name, path)    ||
+             !this->hasCoordinates(name, path))
+             return (false);
+
+         StdString dimname = this->getDimensionsList(&name, path).back();
+
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
+               if ((dimvar.size() == 1) &&
+                   (dimvar.find(dimname) != dimvar.end()))
+                  continue;
+               else
+                  return (false);
+            }
+            else return (false);
+         }
+
+         return (true);
+      }
+
+      bool CINetCDF4::isUnknown(const StdString & name, const CVarPath * const path)
+      {
+         return !(this->isRectilinear(name, path) ||
+                  this->isCurvilinear(name, path) ||
+                  this->isUnstructured(name, path));
+      }
+
+      bool CINetCDF4::isTemporal(const StdString & name, const CVarPath  * const path)
+      {
+         if (!this->hasTemporalDim(path)) return (false);
+         std::map<StdString, StdSize> dims = this->getDimensions(&name, path);
+         if (dims.find(this->getUnlimitedDimensionName(path)) != dims.end())
+            return (true);
+         return (false);
+      }
+
+      bool CINetCDF4::is3Dim(const StdString & name, const CVarPath  * const path)
+      {
+         int i = 0;
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               if (this->isTemporal(coord, path))
+                  continue;
+               i++;
+            }
+            else
+            {
+               if (coord.compare(this->getUnlimitedDimensionName()) == 0)
+                  continue;
+               i++;
+            }
+         }
+         return (i == 3);
+      }
+
+      bool CINetCDF4::isCellGrid(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isCoordinate(name, path))
+         {
+            return (this->hasBounds(name, path));
+         }
+         else
+         {
+            std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+            std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+            for (; it != end; it++)
+            {
+               const StdString & coord = *it;
+               if (this->hasVariable(coord, path))
+               {
+                  if (this->isTemporal(coord, path))
+                     continue;
+                  if (this->isCellGrid(coord, path))
+                     continue;
+                  return (false);
+               }
+               else
+               {
+                  if (coord.compare(this->getUnlimitedDimensionName()) == 0)
+                     continue;
+                  return (false);
+               }
+            }
+         }
+
+         return (true);
+      }
+
+      //---------------------------------------------------------------
+
+      std::list<StdString> CINetCDF4::getDataVariables(bool _is3D,       bool _isRecti,
+                                                       bool _isCurvi,    bool _isUnstr,
+                                                       bool _isCellData, bool _isTemporal,
+                                                       const CVarPath * const path)
+      {
+         std::list<StdString> retvalue;
+         std::list<StdString> allvars  = this->getVariables(path);
+         std::set<StdString> allcoords = this->getCoordVariables(path);
+
+         std::list<StdString>::const_iterator it = allvars.begin(), end = allvars.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            if (this->isCoordinate(var, path)) continue;
+
+            if (!_isRecti && this->isRectilinear(var, path) ) continue;
+            if (!_isCurvi && this->isCurvilinear(var, path) ) continue;
+            if (!_isUnstr && this->isUnstructured(var, path)) continue;
+
+            if (!_isTemporal && this->isTemporal(var, path)) continue;
+            if (!_is3D       && this->is3Dim(var, path)    ) continue;
+            if (!_isCellData && this->isCellGrid(var, path)) continue;
+
+            if (this->isUnknown(var, path)) continue;
+
+            retvalue.push_back(var);
+         }
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      void CINetCDF4::getDataInfo(const StdString & var, const CVarPath  * const path, StdSize record,
+                                  std::vector<StdSize> & start, std::vector<StdSize> & count,
+                                  StdSize & array_size)
+      {
+         std::list<StdString> dimlist        = this->getDimensionsList(&var, path);
+         std::map<StdString, StdSize> dimmap = this->getDimensions(&var, path);
+         std::list<StdString>::iterator it   = dimlist.begin();
+         if (this->isTemporal(var, path))
+         {
+            if (record != UNLIMITED_DIM)
+               start.push_back(record);
+            else
+               start.push_back(0);
+            count.push_back(1);
+            it++;
+         }
+         for (; it != dimlist.end(); it++)
+         {
+            start.push_back(0);
+            count.push_back(dimmap[*it]);
+            array_size *= dimmap[*it];
+         }
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_int (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_double (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_float (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      //---------------------------------------------------------------
+      StdString CINetCDF4::getLonCoordName(const StdString & varname,
+                                           const CVarPath  * const path)
+      {
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*clist.begin());
+         else
+            return (*clist.rbegin());
+      }
+
+      StdString CINetCDF4::getLatCoordName(const StdString & varname,
+                                           const CVarPath  * const path)
+      {
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*(++clist.begin()));
+         else
+            return (*(++clist.rbegin()));
+      }
+
+      StdString CINetCDF4::getVertCoordName(const StdString & varname,
+                                            const CVarPath  * const path)
+      {
+         if (!this->is3Dim(varname, path)) return ("");
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*(++(++clist.begin())));
+         else
+            return (*(++(++clist.rbegin())));
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/input/inetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/input/inetcdf4.hpp	(revision 306)
+++ /XIOS/trunk/src/input/inetcdf4.hpp	(revision 306)
@@ -0,0 +1,239 @@
+#ifndef __XMLIO_INETCDF4__
+#define __XMLIO_INETCDF4__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+#include <mpi.h>
+#define MPI_INCLUDED
+#include <netcdf.h>
+
+#ifndef UNLIMITED_DIM
+   #define UNLIMITED_DIM (size_t)(-1)
+#endif  //UNLIMITED_DIM
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef std::vector<StdString> CVarPath;
+
+      class CINetCDF4
+      {
+         public :
+
+            /// Constructeurs ///
+            CINetCDF4(void);                             // Not implemented.
+            CINetCDF4(const StdString & filename);
+            CINetCDF4(const CINetCDF4 & inetcdf4);       // Not implemented.
+            CINetCDF4(const CINetCDF4 * const inetcdf4); // Not implemented.
+
+         //-------------------------------------------------------------
+
+            /// Accesseurs ///
+            StdSize getNbOfTimestep(const CVarPath  * const path = NULL);
+
+            StdString getUnlimitedDimensionName(const CVarPath  * const path = NULL);
+
+            StdString getCoordinatesId(const StdString & name,
+                                       const CVarPath  * const path = NULL);
+
+            StdString getBoundsId(const StdString & name,
+                                  const CVarPath  * const path = NULL);
+
+            StdString getLonCoordName(const StdString & varname,
+                                      const CVarPath  * const path = NULL);
+            StdString getLatCoordName(const StdString & varname,
+                                       const CVarPath  * const path = NULL);
+            StdString getVertCoordName(const StdString & varname,
+                                       const CVarPath  * const path = NULL);
+
+            std::set<StdString> getCoordVariables(const CVarPath * const path = NULL);
+            std::set<StdString> getBoundVariables(const CVarPath * const path = NULL);
+
+            std::list<StdString> getGroups   (const CVarPath * const path = NULL);
+            std::list<StdString> getVariables(const CVarPath * const path = NULL);
+
+            std::list<StdString> getDataVariables(bool _is3D       = true,
+                                                  bool _isRecti    = true,
+                                                  bool _isCurvi    = true,
+                                                  bool _isUnstr    = true,
+                                                  bool _isCellData = true,
+                                                  bool _isTemporal = true,
+                                                  const CVarPath * const path = NULL);
+
+            std::list<StdString> getAttributes
+                                (const StdString * const var  = NULL,
+                                 const CVarPath  * const path = NULL);
+
+            std::list<StdString> getDimensionsList
+                                (const StdString * const var  = NULL,
+                                 const CVarPath  * const path = NULL);
+
+            std::list<StdString> getCoordinatesIdList(const StdString & name,
+                                                      const CVarPath  * const path = NULL);
+
+            std::map<StdString, StdSize> getDimensions (const StdString * const var  = NULL,
+                                 			const CVarPath  * const path = NULL);
+
+            StdSize getNbVertex(const StdString & name,
+                                const CVarPath  * const path = NULL);
+         //-------------------------------------------------------------
+
+            template <class T>
+               T getMissingValue(const StdString & name,
+                                 const CVarPath  * const path = NULL);
+
+            template <class T>
+               T getAttributeValue(const StdString & name,
+                                   const StdString * const var  = NULL,
+                                   const CVarPath  * const path = NULL);
+
+            template <class T>
+               void getData(ARRAY(T, 1) data,
+                            const StdString & var,
+                            const CVarPath  * const path = NULL,
+                            StdSize record   = UNLIMITED_DIM);
+
+         //-------------------------------------------------------------
+
+            /// Tests ///
+            bool hasMissingValue(const StdString & name,
+                                 const CVarPath  * const path = NULL);
+
+            bool hasAttribute(const StdString & name,
+                              const StdString * const var  = NULL,
+                              const CVarPath  * const path = NULL);
+
+            bool hasVariable(const StdString & name,
+                             const CVarPath  * const path = NULL);
+
+            bool hasCoordinates(const StdString & name,
+                                const CVarPath  * const path = NULL);
+
+            bool hasTemporalDim(const CVarPath  * const path = NULL);
+
+            bool hasBounds(const StdString & name,
+                           const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            bool isBound(const StdString & name,
+                         const CVarPath  * const path = NULL);
+            bool isCoordinate(const StdString & name,
+                              const CVarPath  * const path = NULL);
+            bool isRectilinear(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isCurvilinear(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isUnknown(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isUnstructured(const StdString & name,
+                                const CVarPath  * const path = NULL);
+
+            bool isTemporal(const StdString & name,
+                            const CVarPath  * const path = NULL);
+            bool is3Dim(const StdString & name,
+                        const CVarPath  * const path = NULL);
+            bool isCellGrid(const StdString & name,
+                            const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            /// Destructeur ///
+            virtual ~CINetCDF4(void);
+
+         protected :
+
+         //-------------------------------------------------------------
+
+            /// Accesseurs ///
+            int getGroup   (const CVarPath * const path = NULL);
+            int getVariable(const StdString & varname,
+                            const CVarPath * const path = NULL);
+            int getDimension(const StdString & dimname,
+                             const CVarPath  * const path = NULL);
+            int getUnlimitedDimension(const CVarPath  * const path = NULL);
+            int getAttributeId(const StdString & name,
+                               const StdString * const var  = NULL,
+                               const CVarPath  * const path = NULL);
+
+            std::pair<nc_type , StdSize> getAttribute(const StdString & attname,
+                                                      const StdString * const var  = NULL,
+                                                      const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            void getDataInfo(const StdString & var, const CVarPath  * const path, StdSize record,
+                             std::vector<StdSize> & start, std::vector<StdSize> & count,
+                             StdSize & array_size);
+
+         private :
+
+            /// VÃ©rification des erreurs NetCDF ///
+            static void CheckError(int status);
+
+            int ncidp; // Identifiant de fichier netcdf.
+
+      }; // class CINetCDF4
+
+      ///--------------------------------------------------------------
+      template <>
+         StdString CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<double> CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<float> CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<int>  CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<char>  CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      //---------------------------------------------------------------
+      template <>
+         int CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      template <>
+         double CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      template <>
+         float CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      //---------------------------------------------------------------
+      template <>
+         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+
+      template <>
+         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+
+      template <>
+         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_INETCDF4__
Index: /XIOS/trunk/src/input/nc4_data_input.cpp
===================================================================
--- /XIOS/trunk/src/input/nc4_data_input.cpp	(revision 306)
+++ /XIOS/trunk/src/input/nc4_data_input.cpp	(revision 306)
@@ -0,0 +1,15 @@
+#include "nc4_data_input.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CNc4DataInput::CNc4DataInput(void)
+      { /* ne rien faire de plus */ }
+
+      CNc4DataInput::~CNc4DataInput(void)
+      { /* ne rien faire de plus */ }
+
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/input/nc4_data_input.hpp
===================================================================
--- /XIOS/trunk/src/input/nc4_data_input.hpp	(revision 306)
+++ /XIOS/trunk/src/input/nc4_data_input.hpp	(revision 306)
@@ -0,0 +1,31 @@
+#ifndef __XMLIO_NC4_DATA_INPUT__
+#define __XMLIO_NC4_DATA_INPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "inetcdf4.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CNc4DataInput
+      {
+         public :
+
+            /// Constructeurs ///
+            CNc4DataInput(void);
+            CNc4DataInput(const CNc4DataInput & datainput);       // Not implemented.
+            CNc4DataInput(const CNc4DataInput * const datainput); // Not implemented.
+
+            /// Destructeur ///
+            virtual ~CNc4DataInput(void);
+
+      }; // class CNc4DataInput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_NC4_DATA_INPUT__
Index: /XIOS/trunk/src/linear_buffer.cpp
===================================================================
--- /XIOS/trunk/src/linear_buffer.cpp	(revision 306)
+++ /XIOS/trunk/src/linear_buffer.cpp	(revision 306)
@@ -0,0 +1,300 @@
+#include "linear_buffer.hpp"
+
+#include "linear_buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CLinearBuffer::CLinearBuffer(char * data, StdSize size)
+         : SuperClass(data, size), bdata(), p_write(size)
+      { this->computeBufferData(); }
+
+      CLinearBuffer::CLinearBuffer(StdSize size)
+         : SuperClass(size), bdata(), p_write(0)
+      { /* Ne rien faire de plus */ }
+      
+      CLinearBuffer::CLinearBuffer(const CLinearBuffer & lbuffer)
+         : SuperClass(lbuffer), bdata(lbuffer.bdata), p_write(lbuffer.p_write)
+      { /* Ne rien faire de plus */ }
+      
+      CLinearBuffer::CLinearBuffer(const CLinearBuffer * const lbuffer)
+         : SuperClass(lbuffer), bdata(lbuffer->bdata), p_write(lbuffer->p_write)      
+      { /* Ne rien faire de plus */ }
+      
+      CLinearBuffer::~CLinearBuffer(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      long int * CLinearBuffer::NULL_ARG = NULL;
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::clear(void)
+      { 
+         this->bdata.clear();
+         //SuperClass::fillData('\0', SuperClass::getSize(), 0);
+         this->p_write = 0;
+      }
+      
+      //---------------------------------------------------------------
+      
+      StdSize CLinearBuffer::getUsedSize(void) const
+      { 
+         return (this->p_write); 
+      }
+      
+      //---------------------------------------------------------------
+      
+      StdSize CLinearBuffer::getUnusedSize(void) const
+      {
+          return (SuperClass::getSize() - this->getUsedSize()); 
+      }
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferGetter(type, Type) \
+   type CLinearBuffer::get##Type(StdSize position) const     \
+   {                                                         \
+      if (position >= bdata.size())                          \
+         ERROR("CLinearBuffer::get"#Type"(position)",        \
+               << " invalid position !");                    \
+      return (SuperClass::get##Type(this->bdata[position])); \
+   }
+
+      CLinearBufferGetter(char     , Char)
+      CLinearBufferGetter(bool     , Bool)
+      CLinearBufferGetter(float    , Float)
+      CLinearBufferGetter(double   , Double)
+      CLinearBufferGetter(long int , Int)
+
+#undef CLinearBufferGetter
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferArrayGetter(type, Type) \
+   ARRAY(type, 1) CLinearBuffer::get##Type##Array(StdSize position) const \
+   {                                                                      \
+      if (position >= bdata.size())                                       \
+         ERROR("CLinearBuffer::get"#Type"Array(position)",                \
+               << " invalid position !");                                 \
+      return (SuperClass::get##Type##Array(this->bdata[position]));       \
+   }
+
+      CLinearBufferArrayGetter(char     , Char)
+      CLinearBufferArrayGetter(bool     , Bool)
+      CLinearBufferArrayGetter(float    , Float)
+      CLinearBufferArrayGetter(double   , Double)
+      CLinearBufferArrayGetter(long int , Int)
+
+#undef CLinearBufferArrayGetter
+
+      StdString CLinearBuffer::getString(StdSize position) const
+      { return (SuperClass::getString(this->bdata[position])); }
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferSetter(type, Type)                        \
+      void  CLinearBuffer::append##Type(type value)            \
+      {                                                        \
+         this->bdata.push_back(this->p_write);                 \
+         SuperClass::set##Type(value, this->p_write);          \
+         this->p_write += SuperClass::getRequestedSize(value); \
+      }
+
+      CLinearBufferSetter(char     , Char)
+      CLinearBufferSetter(bool     , Bool)
+      CLinearBufferSetter(float    , Float)
+      CLinearBufferSetter(double   , Double)
+      CLinearBufferSetter(long int , Int)
+
+#undef CLinearBufferSetter
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferArraySetter(type, Type) \
+      void  CLinearBuffer::append##Type##Array(ARRAY(type, 1) value) \
+      {                                                              \
+         this->bdata.push_back(this->p_write);                       \
+         SuperClass::set##Type##Array(value, this->p_write);         \
+         this->p_write += SuperClass::getRequestedSize(value);       \
+      }
+
+      CLinearBufferArraySetter(char     , Char)
+      CLinearBufferArraySetter(bool     , Bool)
+      CLinearBufferArraySetter(float    , Float)
+      CLinearBufferArraySetter(double   , Double)
+      CLinearBufferArraySetter(long int , Int)
+
+#undef CLinearBufferArrayAppend
+
+      void CLinearBuffer::appendString(const StdString & value)
+      {
+         ARRAY_CREATE(arr, char, 1, [value.size()]);
+         std::copy(value.data(), &(value.data()[value.size()]), arr->data());
+         this->appendCharArray(arr);
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CLinearBuffer::getNumberOfStoredData(void) const
+      { 
+         return (this->bdata.size()); 
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::vector<StdSize> CLinearBuffer::getPositionsOfStoredData(void) const
+      {
+         std::vector<StdSize> retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(bufdata.position);
+         }
+
+         return (retvalue);
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::vector<StdSize> CLinearBuffer::getSizesOfStoredData(void) const
+      {
+         std::vector<StdSize> retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(bufdata.size);
+         }
+         return (retvalue);
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::vector<std::pair<CBuffer::CBufferDataType, bool> >
+         CLinearBuffer::getTypesOfStoredData(void) const
+      {
+         std::vector<std::pair<CBufferDataType, bool> > retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(std::make_pair(bufdata.type, bufdata.isArray));
+         }
+
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::computeBufferData(void)
+      {
+
+         CBufferData bufdata; this->clear();
+         StdSize total_size = SuperClass::getSize();
+         int i = 0;
+         while ((1000 >= i++) && (p_write != total_size))
+         {
+            bdata.push_back(this->p_write);
+            SuperClass::updateBufferData(this->p_write);
+            SuperClass::getBufferData(bufdata, this->p_write);
+            this->p_write = (bufdata.size + bufdata.position);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::appendRequestInfos(const long int & managerId,
+                                             const long int & methodId,
+                                             const long int & nbargs)
+      {
+         this->appendInt(managerId);
+         this->appendInt(methodId);
+         this->appendInt(nbargs);
+      }
+
+      void CLinearBuffer::getRequestInfos(StdSize position,
+                           long int & managerId, long int & methodId, long int & nbargs)
+      {
+         managerId = this->getInt(position);
+         methodId  = this->getInt(position+1);
+         nbargs    = this->getInt(position+2);
+      }
+
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::printToTextFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToTextStream(ofs);
+         ofs.close();
+      }
+
+      void CLinearBuffer::printToTextStream (StdOStream & ostr)
+      { // A amÃ©liorer ....
+         StdSize position = 0;
+         typedef std::pair<CBufferDataType, bool> pairBufBool;
+         std::vector<pairBufBool> vect = this->getTypesOfStoredData();
+         ostr << "|";
+         
+         std::vector<pairBufBool>::const_iterator it = vect.begin(), end = vect.end();
+         for (;it != end; it++)
+         {
+            pairBufBool elm = *it;
+            ostr << "|";
+            if (!elm.second)
+            {
+               switch (elm.first)
+               {
+                  case (TBOOL8):    ostr << this->getBool(position);
+                     break;
+                  case (TINT32):    ostr << this->getInt(position);
+                     break;
+                  case (TCHAR8):    ostr << this->getChar(position);
+                     break;
+                  case (TFLOAT32):  ostr << this->getFloat(position);
+                     break;
+                  case (TDOUBLE64): ostr << this->getDouble(position);
+                     break;
+                  default :
+                     return;
+               }
+            }
+            else
+            {
+               switch (elm.first)
+               {
+                  case (TBOOL8):    ostr << this->getBoolArray(position);
+                     break;
+                  case (TINT32):    ostr << this->getIntArray(position);
+                     break;
+                  case (TCHAR8):    ostr << this->getCharArray(position);
+                     break;
+                  case (TFLOAT32):  ostr << this->getFloatArray(position);
+                     break;
+                  case (TDOUBLE64): ostr << this->getDoubleArray(position);
+                     break;
+                  default :
+                     return;
+               }
+            }
+            position++;
+         }
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/linear_buffer.hpp
===================================================================
--- /XIOS/trunk/src/linear_buffer.hpp	(revision 306)
+++ /XIOS/trunk/src/linear_buffer.hpp	(revision 306)
@@ -0,0 +1,133 @@
+#ifndef __XMLIO_CLinearBuffer__
+#define __XMLIO_CLinearBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+
+#define _NULL_ARG xmlioserver::comm::CLinearBuffer::NULL_ARG
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CLinearBuffer
+         : public CBuffer
+      {
+            /// DÃ©finition de type ///
+            typedef CBuffer SuperClass;
+
+         public /* static */ :
+
+            static long int * NULL_ARG;
+            friend class CMPIManager;
+
+         public :
+
+            /// Construteurs ///
+
+            explicit CLinearBuffer(StdSize size = BUFFER_CLIENT_SIZE);
+            CLinearBuffer(char * data, StdSize size);
+            CLinearBuffer(const CLinearBuffer & lbuffer);
+            CLinearBuffer(const CLinearBuffer * const lbuffer);
+
+            /// Accesseurs ///
+            StdSize getUsedSize(void) const;
+            StdSize getUnusedSize(void) const;
+
+            StdSize getNumberOfStoredData(void) const;
+            std::vector<StdSize> getPositionsOfStoredData(void) const;
+            std::vector<StdSize> getSizesOfStoredData(void) const;
+            std::vector<std::pair<CBufferDataType, bool> > getTypesOfStoredData(void) const;
+
+         //--------------------------------------------------------------
+            char     getChar  (StdSize position) const;
+            bool     getBool  (StdSize position) const;
+            float    getFloat (StdSize position) const;
+            double   getDouble(StdSize position) const;
+            long int getInt   (StdSize position) const;
+
+            StdString getString(StdSize position) const;
+
+            ARRAY(char,     1) getCharArray  (StdSize position) const;
+            ARRAY(bool,     1) getBoolArray  (StdSize position) const;
+            ARRAY(float,    1) getFloatArray (StdSize position) const;
+            ARRAY(double,   1) getDoubleArray(StdSize position) const;
+            ARRAY(long int, 1) getIntArray   (StdSize position) const;
+
+         //--------------------------------------------------------------
+
+            void getRequestInfos(StdSize position,
+                     long int & managerId, long int & methodId, long int & nbargs);
+
+         //--------------------------------------------------------------
+            /// Mutateurs ///
+            void appendChar  (char     value) ;
+            void appendBool  (bool     value) ;
+            void appendFloat (float    value) ;
+            void appendDouble(double   value) ;
+            void appendInt   (long int value) ;
+
+            void appendString(const StdString & value) ;
+
+            void appendCharArray  (ARRAY(char,     1) value) ;
+            void appendBoolArray  (ARRAY(bool,     1) value) ;
+            void appendFloatArray (ARRAY(float,    1) value) ;
+            void appendDoubleArray(ARRAY(double,   1) value) ;
+            void appendIntArray   (ARRAY(long int, 1) value) ;
+
+         //--------------------------------------------------------------
+
+            void appendRequestInfos(const long int & managerId,
+                                    const long int & methodId,
+                                    const long int & nbargs);
+
+         //--------------------------------------------------------------
+            virtual void clear(void);
+
+            /// Test ///
+            template <typename A1, typename A2, typename A3, typename A4>
+               inline StdSize getRequestedSize(A1 * arg1 = NULL_ARG,
+                                               A2 * arg2 = NULL_ARG,
+                                               A3 * arg3 = NULL_ARG,
+                                               A4 * arg4 = NULL_ARG) const;
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename);
+            virtual void printToTextStream (StdOStream & ostr);
+
+            /// Destructeur ///
+            virtual ~CLinearBuffer(void);
+
+         protected :
+
+            /// Accesseurs protÃ©gÃ©s ///
+            template <class T>
+               inline void getLData(T & data, StdSize position) const;
+            template <class T>
+               inline void getLDataArray(ARRAY(T, 1) data, StdSize position) const;
+
+            /// Mutateurs protÃ©gÃ©s ///
+            template <class T>
+               inline void appendLData(const T & data);
+            template <class T>
+               inline void appendLDataArray(ARRAY(T, 1) data);
+
+         private :
+
+            /// Traitement ///
+            void computeBufferData(void);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            std::vector<StdSize> bdata;
+            StdSize p_write;
+
+      }; // class CLinearBuffer
+
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CLinearBuffer__
Index: /XIOS/trunk/src/linear_buffer_impl.hpp
===================================================================
--- /XIOS/trunk/src/linear_buffer_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/linear_buffer_impl.hpp	(revision 306)
@@ -0,0 +1,69 @@
+#ifndef __XMLIO_CLinearBuffer_impl__
+#define __XMLIO_CLinearBuffer_impl__
+
+#include "buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////// DÃ©finitions (inline) /////////////////// ///
+
+      template <class T>
+         void CLinearBuffer::getLData(T & data, StdSize position) const
+      {
+         if (position >= bdata.size())
+            ERROR("CLinearBuffer::getData(position)",
+                  << " invalid position !");
+         SuperClass::getData(data, this->bdata[position]);
+      }
+
+      template <class T>
+          void CLinearBuffer::getLDataArray(ARRAY(T, 1) data, StdSize position) const
+      {
+         if (position >= bdata.size())
+            ERROR("CLinearBuffer::getDataArray(position)",
+                  << " invalid position !");
+         SuperClass::getDataArray(data, this->bdata[position]);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CLinearBuffer::appendLData(const T & data)
+      {
+         this->bdata.push_back(this->p_write);
+         SuperClass::setData(data, this->p_write);
+         this->p_write += SuperClass::getRequestedSize(data);
+      }
+
+      template <class T>
+         void CLinearBuffer::appendLDataArray(ARRAY(T, 1) data)
+      {
+         this->bdata.push_back(this->p_write);
+         SuperClass::setDataArray(data, this->p_write);
+         this->p_write += SuperClass::getRequestedSize(data);
+      }
+      //---------------------------------------------------------------
+
+      template <typename A1, typename A2, typename A3, typename A4>
+         StdSize CLinearBuffer::getRequestedSize
+          ( A1 * arg1, A2 * arg2, A3 * arg3, A4 * arg4) const
+      {
+         StdSize retvalue = 0;
+         long int nbarg   = 0;
+         retvalue += 3 * SuperClass::getRequestedSize(nbarg);
+
+         if (arg1 != NULL) retvalue += SuperClass::getRequestedSize(*arg1);
+         if (arg2 != NULL) retvalue += SuperClass::getRequestedSize(*arg2);
+         if (arg3 != NULL) retvalue += SuperClass::getRequestedSize(*arg3);
+         if (arg4 != NULL) retvalue += SuperClass::getRequestedSize(*arg4);
+         return (retvalue);
+      }
+
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CLinearBuffer_impl__
Index: /XIOS/trunk/src/log.cpp
===================================================================
--- /XIOS/trunk/src/log.cpp	(revision 306)
+++ /XIOS/trunk/src/log.cpp	(revision 306)
@@ -0,0 +1,6 @@
+#include "log.hpp"
+
+namespace xmlioserver
+{
+  CLog info ;
+}
Index: /XIOS/trunk/src/log.hpp
===================================================================
--- /XIOS/trunk/src/log.hpp	(revision 306)
+++ /XIOS/trunk/src/log.hpp	(revision 306)
@@ -0,0 +1,34 @@
+#ifndef __XIOS_LOG__
+
+#include <iostream>
+
+namespace xmlioserver
+{
+  using namespace std ;
+
+  class CLog : public ostream
+  {
+    public :
+    CLog(void) : ostream(cout.rdbuf()),level(0) {}
+    CLog& operator()(int l) 
+    {  
+      if (l<=level) 
+      {
+        rdbuf(cout.rdbuf()) ;
+        *this<<"-> info : " ;
+      }
+      else rdbuf(NULL) ;
+      return *this;
+    }
+    void setLevel(int l) {level=l; } 
+    int getLevel() {return level ;}
+    bool isActive(void) { if (rdbuf()==NULL) return true ; else return false ;}
+    bool isActive(int l) {if (l<=level) return true ; else return false ; }
+
+    private :
+    int level ;
+  };
+
+  extern CLog info;
+}
+#endif
Index: /XIOS/trunk/src/main_server.cpp
===================================================================
--- /XIOS/trunk/src/main_server.cpp	(revision 306)
+++ /XIOS/trunk/src/main_server.cpp	(revision 306)
@@ -0,0 +1,49 @@
+// XmlIOServer
+#include "xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "client.hpp"
+#include "server.hpp"
+#include "oasis_cinterface.hpp"
+#include <string>
+#include <iostream>
+
+#include <unistd.h>
+
+
+
+// Point d'entrÃ©e du programme principal
+
+int main (int argc, char ** argv, char ** UNUSED (env))
+{
+   try
+   {
+      MPI_Comm comm_client=MPI_COMM_NULL, comm_client_server=MPI_COMM_NULL, comm_server=MPI_COMM_NULL, comm_parent=MPI_COMM_NULL;
+//      sleep(60) ;
+      CTreeManager::ParseFile("iodef.xml");
+
+      CTreeManager::SetCurrentContextId(StdString("xios"));
+      boost::shared_ptr<CVariable> var = CObjectFactory::GetObject<CVariable>("buffer_client_size"); 
+     
+//      oasis_init(std::string("ionemo")) ;
+//      oasis_get_intracomm(comm_parent,std::string("oceanx")) ;
+      CXIOSManager::Initialise(CXIOSManager::CLIENT_SERVER, &argc, &argv);
+     
+      CMPIManager::DispatchClient(true, comm_client, comm_client_server, comm_server, comm_parent);
+      CXIOSManager::RunServer("Nemo", comm_client_server, comm_server);
+      CTreeManager::SetCurrentContextId(StdString("nemo"));
+      CServer::CreateServer(comm_client_server)->run();
+      CXIOSManager::Finalize ();  
+
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage () << std::endl;
+      CMPIManager::Finalize ();
+      return (EXIT_FAILURE);
+   }
+   return (EXIT_SUCCESS);
+}
+
Index: /XIOS/trunk/src/manager/mpi_manager.cpp
===================================================================
--- /XIOS/trunk/src/manager/mpi_manager.cpp	(revision 306)
+++ /XIOS/trunk/src/manager/mpi_manager.cpp	(revision 306)
@@ -0,0 +1,425 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+ 
+ /**
+ * \file    mpi_interface.cpp
+ * \brief   Gestion des communications MPI via une surcouche interne (implÃ©mentation).
+ * \author  HervÃ© Ozdoba
+ * \version 0.4
+ * \date    28 Juin 2011
+ */
+ 
+// XMLIOServer headers
+#include "xmlioserver.hpp"
+#include "mpi_manager.hpp"
+#include "oasis_cinterface.hpp"
+
+
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+namespace xmlioserver {
+namespace comm {
+
+   // ---------------------- Initialisation & Finalisation ---------------------
+
+   bool CMPIManager::Initialized=false ;
+   MPI_Comm CMPIManager::CommClient ;
+   MPI_Comm CMPIManager::CommServer ;
+   MPI_Comm CMPIManager::CommClientServer ;
+   int CMPIManager::NbClient ;
+   int CMPIManager::NbServer ;   
+   bool CMPIManager::_IsClient ;
+   bool CMPIManager::_IsServer ;   
+   bool CMPIManager::using_server ;
+   bool CMPIManager::using_oasis ;
+
+
+   void CMPIManager::Initialise(int * _argc, char *** _argv)
+   {
+      int flag = 0;
+      if (MPI_Initialized(&flag) != MPI_SUCCESS)
+         ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+      if (!flag)
+      {
+         if (MPI_Init(_argc, _argv) != MPI_SUCCESS)
+            ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+         Initialized=true ;
+      }
+
+   }
+   void CMPIManager::InitialiseClient(int * _argc, char *** _argv)
+   {
+      int flag = 0;
+      using_oasis=CObjectFactory::GetObject<CVariable>("xios","using_oasis")->getData<bool>() ; 
+      using_server=CObjectFactory::GetObject<CVariable>("xios","using_server")->getData<bool>(); 
+
+      Initialized=false ;
+
+      if (MPI_Initialized(&flag) != MPI_SUCCESS)
+         ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+
+      if (!flag)
+      {
+         if (using_oasis) 
+         {
+           StdString oasisClientId=CObjectFactory::GetObject<CVariable>("xios","client_id")->getData<StdString>();
+           oasis_init(oasisClientId) ;
+         }
+         else
+         {        
+           if (MPI_Init(_argc, _argv) != MPI_SUCCESS)
+            ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+         }
+         Initialized=true ;
+       }
+
+   }
+   
+   void CMPIManager::InitialiseServer(int * _argc, char *** _argv)
+   {
+      int flag = 0;
+      
+      using_oasis=CObjectFactory::GetObject<CVariable>("xios","using_oasis")->getData<bool>(); 
+      using_server=CObjectFactory::GetObject<CVariable>("xios","using_server")->getData<bool>(); 
+   
+      if (using_oasis)
+      {
+         StdString oasisServerId=CObjectFactory::GetObject<CVariable>("xios","server_id")->getData<StdString>(); 
+         oasis_init(oasisServerId) ;
+      }
+      else
+      {
+         if (MPI_Init(_argc, _argv) != MPI_SUCCESS)
+            ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+      }
+      Initialized=true ;
+   }
+    
+   void CMPIManager::Finalize(void)
+   {
+      if (Initialized)
+      {
+        if (using_oasis) oasis_finalize() ;
+        else if (MPI_Finalize() != MPI_SUCCESS)
+                ERROR("CMPIManager::Finalize(void)", << " MPI Error !");
+      }
+   }
+   
+   // ------------------------------ Communicateurs ----------------------------
+   
+   int CMPIManager::GetCommRank(MPI_Comm _comm)
+   {
+      int rank = 0;
+      if (MPI_Comm_rank(_comm, &rank) != MPI_SUCCESS)
+         ERROR("CMPIManager::GetCommRank(comm)", << " MPI Error !");
+      return (rank);
+   }
+   
+   int CMPIManager::GetCommSize(MPI_Comm _comm)
+   {
+      int size = 0;
+      if (MPI_Comm_size(_comm, &size) != MPI_SUCCESS)
+         ERROR("CMPIManager::GetCommSize(comm)", << " MPI Error !");
+      return (size);
+   }
+   
+   MPI_Comm CMPIManager::CreateComm(MPI_Group _group, MPI_Comm _pcomm)
+   {
+      MPI_Comm commu;      
+      if (MPI_Comm_create(_pcomm, _group, &commu) != MPI_SUCCESS)
+         ERROR("CMPIManager::CreateComm(group, pcomm)", << " MPI Error !");
+      return (commu);
+   }
+   
+   //MPI_Comm CMPIManager::GetCommWorld(void)
+   //{
+   //   return (MPI_COMM_WORLD); 
+   //}
+   
+   // ---------------------------------- Autre ---------------------------------
+         
+   void CMPIManager::Barrier(MPI_Comm _comm)
+   {
+      if (MPI_Barrier(_comm) != MPI_SUCCESS)
+         ERROR("CMPIManager::Barrier(comm)", << " MPI Error !");
+   }
+   
+   bool CMPIManager::DispatchClient(bool       _is_server,
+                                    MPI_Comm & _comm_client,
+                                    MPI_Comm & _comm_client_server,
+                                    MPI_Comm & _comm_server,
+                                    MPI_Comm   _comm_parent)
+   {
+      if (_is_server) { _IsServer=true ; _IsClient=false ; }
+      else { _IsServer=false ; _IsClient=true; }
+
+      if (_is_server)
+      {
+        if (using_oasis)
+        {
+          StdString oasisClientId=CObjectFactory::GetObject<CVariable>("xios","client_id")->getData<StdString>() ;
+          oasis_get_intracomm(_comm_parent,oasisClientId) ;
+        }
+        else _comm_parent=MPI_COMM_WORLD ;
+      }
+      else
+      {
+        if (!using_server)
+        {
+          NbClient=GetCommSize(_comm_parent) ;
+          NbServer=0 ;
+          _comm_server = _comm_client = _comm_parent ;
+          CommClient=_comm_client ;
+          CommServer=_comm_server ;
+          CommClientServer=_comm_client_server ;
+           return false ;
+        }
+        if (using_oasis)  
+        {
+          StdString oasisServerId=CObjectFactory::GetObject<CVariable>("xios","server_id")->getData<StdString>() ;
+          oasis_get_intracomm(_comm_parent,oasisServerId) ;
+        }
+      }    
+      
+      
+      int value = (_is_server) ? 1 : 2;
+      std::size_t nbClient = 0, nbServer = 0 ;
+      std::vector<int> nbClientByServer ;
+      
+      std::vector<int> info, rank_client, rank_server;
+      CMPIManager::AllGather(value, info, _comm_parent);
+
+      for (std::size_t s = 0;  s < info.size(); s++)
+      {
+         if (info[s] == 1) rank_server.push_back(s);
+         else rank_client.push_back(s);
+      }
+      nbClient = rank_client.size();
+      nbServer = rank_server.size();
+      
+      NbClient=nbClient ;
+      NbServer=nbServer ;
+      
+      if (nbClient == 0)
+         ERROR("CMPIManager::DispatchClient()", << " Aucun client disponible !");
+         
+
+      _comm_client = CMPIManager::CreateComm(CMPIManager::CreateSubGroup(
+                     CMPIManager::GetGroup(_comm_parent), rank_client), _comm_parent);
+
+      if (nbServer != 0)
+      {
+         std::size_t currentServer = 0;
+         
+//         nbClientByServer = nbClient/nbServer;
+         _comm_server = CMPIManager::CreateComm(CMPIManager::CreateSubGroup(
+                        CMPIManager::GetGroup(_comm_parent), rank_server), _comm_parent);
+
+         for(std::size_t mm=0;mm<nbServer;mm++) 
+         {
+           int x=nbClient/nbServer ;
+           if (mm<nbClient%nbServer) x++ ;
+           nbClientByServer.push_back(x) ;
+         }
+
+         for (std::size_t mm = 0; mm < nbClient; mm += nbClientByServer[currentServer],currentServer++ )
+         {
+            std::vector<int> group_rank;
+            group_rank.push_back(rank_server[currentServer]);
+            for (std::size_t nn = 0; nn < nbClientByServer[currentServer]; nn++)
+               group_rank.push_back(rank_client[nn+mm]);
+            MPI_Comm comm_client_server_ = CMPIManager::CreateComm(CMPIManager::CreateSubGroup(
+                                           CMPIManager::GetGroup(_comm_parent), group_rank), _comm_parent);
+
+            if (std::find(group_rank.begin(), group_rank.end(),
+                         CMPIManager::GetCommRank(_comm_parent)) != group_rank.end())
+            {
+               _comm_client_server = comm_client_server_;
+            }
+               
+            group_rank.clear();
+         }
+         CommClient=_comm_client ;
+         CommServer=_comm_server ;
+         CommClientServer=_comm_client_server ;
+         return (true);
+      }
+      else
+      {
+         _comm_server = _comm_client;
+         CommClient=_comm_client ;
+         CommServer=_comm_server ;
+         CommClientServer=_comm_client_server ;
+         return (false);
+      }
+   }
+   
+
+   // --------------------------------- Groupes --------------------------------
+         
+   MPI_Group CMPIManager::GetGroupWorld(void)
+   {
+      MPI_Group group = 0;
+      if (MPI_Comm_group(MPI_COMM_WORLD, &group) != MPI_SUCCESS)
+         ERROR("CMPIManager::GetGroupWorld()", << " MPI Error !");
+      return (group);
+   }
+
+   MPI_Group CMPIManager::GetGroup(MPI_Comm comm)
+   {
+      MPI_Group group = 0;
+      if (MPI_Comm_group(comm, &group) != MPI_SUCCESS)
+         ERROR("CMPIManager::GetGroup()", << " MPI Error !");
+      return (group);
+   }
+   
+   MPI_Group CMPIManager::CreateSubGroup(MPI_Group _pgroup, const std::vector<int> & _ranks)
+   {
+      MPI_Group group = 0;
+      if (MPI_Group_incl(_pgroup, _ranks.size(), const_cast<int*>(&(_ranks[0])), &group) != MPI_SUCCESS)
+         ERROR("CMPIManager::CreateSubGroup(pgroup, ranks)", << " MPI Error !");
+      return (group);
+   }
+   
+   MPI_Group CMPIManager::CreateSubGroup
+      (MPI_Group _pgroup, int _min_rank, int _max_rank, int _intval)
+   {
+      std::vector<int> ranks;
+      for (int i = _min_rank; i <= _max_rank; i += _intval)
+         ranks.push_back(i);
+      return (CMPIManager::CreateSubGroup(_pgroup, ranks));
+   }
+
+   // ----------------------------------- Tests --------------------------------
+         
+   bool CMPIManager::IsMaster(MPI_Comm _comm)
+   {
+      return (CMPIManager::GetCommRank(_comm) == 0); 
+   }
+   
+   bool CMPIManager::IsRank(int _rank, MPI_Comm _comm)
+   {
+      return (CMPIManager::GetCommRank(_comm) == _rank); 
+   }
+
+   // --------------------------- Communication simple -------------------------
+         
+   void CMPIManager::Send (MPI_Comm _comm, int _dest_rank, char * _data,
+                           std::size_t _size, MPI_Request & _request)
+   {
+      int nsize = _size;    
+      if (MPI_Issend(_data, nsize, MPI_CHAR, _dest_rank, 0, _comm, &_request) != MPI_SUCCESS)
+         ERROR("CMPIManager::Send (comm, dest_rank, data, size, request)", << " MPI Error !");
+   }
+   
+   void CMPIManager::Wait (MPI_Request & _request)
+   {
+      MPI_Status status;
+      if (MPI_Wait(&_request, &status) != MPI_SUCCESS)
+         ERROR("CMPIManager::Wait (request)", << " MPI Error !");
+   }
+   
+   bool CMPIManager::Test (MPI_Request & _request)
+   {
+      MPI_Status status;
+      int flag = 0;
+      if (MPI_Test(&_request, &flag, &status) != MPI_SUCCESS)
+         ERROR("CMPIManager::Test (request)", << " MPI Error !");
+      return (flag);
+   }
+
+   bool CMPIManager::HasReceivedData(MPI_Comm _comm, int _src_rank)
+   {
+      MPI_Status status;
+      int flag = 0;
+      if (MPI_Iprobe(_src_rank, MPI_ANY_TAG, _comm, &flag, &status) != MPI_SUCCESS)
+         ERROR("CMPIManager::HasReceivedData (comm, rank)", << " MPI Error !");
+      return (flag);
+   }
+   
+   std::size_t CMPIManager::GetReceivedDataSize(MPI_Comm _comm, int _src_rank)
+   {
+      MPI_Status status;
+      int flag = 0, size = 0;
+      if (MPI_Iprobe(_src_rank, MPI_ANY_TAG, _comm, &flag, &status) != MPI_SUCCESS)
+         ERROR("CMPIManager::getReceivedDataSize (comm, rank)", << " MPI Error !");
+      if (!flag) return (0);  
+      if (MPI_Get_count(&status, MPI_CHAR, &size) != MPI_SUCCESS)
+         ERROR("CMPIManager::getReceivedDataSize (comm, rank)", << " MPI Error !");
+
+      return (size);
+   }
+   
+   void CMPIManager::Receive(MPI_Comm _comm, int _src_rank, char * _data)
+   {
+      MPI_Request request = 0;
+      int size = CMPIManager::GetReceivedDataSize(_comm, _src_rank);
+      if (MPI_Irecv(_data, size, MPI_CHAR, _src_rank, MPI_ANY_TAG, _comm, &request) != MPI_SUCCESS)
+         ERROR("CMPIManager::Receive (comm, src_rank, data)", << " MPI Error !");
+      CMPIManager::Wait (request); // Temporaire
+   }
+   
+   void CMPIManager::AllGather(int _indata, std::vector<int> & _outdata, MPI_Comm _comm)
+   {
+      std::vector<int> data; data.push_back(_indata);
+      CMPIManager::AllGather(data, _outdata, _comm);
+   }
+
+   void  CMPIManager::AllGather(const std::vector<int> & _indata,
+                                      std::vector<int> & _outdata, MPI_Comm _comm)
+   {
+      int sendcount = _indata.size(),
+          recvcount = _indata.size() * CMPIManager::GetCommSize(_comm);
+      _outdata.resize(recvcount);     
+      if (MPI_Allgather ( const_cast<int*>(&(_indata[0])), sendcount, MPI_INTEGER,
+                                          &(_outdata[0]) , sendcount, MPI_INTEGER, _comm) != MPI_SUCCESS)
+         ERROR("CMPIManager::AllGather (indata, outdata, comm)", << " MPI Error !");
+   }
+         
+   // ------------------------- Communication 'complexe' -----------------------
+         
+   void CMPIManager::SendLinearBuffer(MPI_Comm _comm, int _dest_rank, CLinearBuffer & _lbuffer, MPI_Request & _request)
+   {
+      CMPIManager::Send(_comm, _dest_rank, _lbuffer, _lbuffer.getUsedSize(), _request);
+      _lbuffer.clear();
+   }
+   
+   void CMPIManager::ReceiveLinearBuffer(MPI_Comm _comm, int _src_rank, CLinearBuffer & _lbuffer)
+   {
+      CMPIManager::Receive(_comm, _src_rank, _lbuffer);
+      _lbuffer.computeBufferData();
+   }
+   
+   boost::shared_ptr<CLinearBuffer> CMPIManager::ReceiveLinearBuffer(MPI_Comm _comm, int _src_rank)
+   {
+      boost::shared_ptr<CLinearBuffer> buff_ptr
+         (new CLinearBuffer(CMPIManager::GetReceivedDataSize(_comm, _src_rank)));
+      CMPIManager::ReceiveLinearBuffer(_comm, _src_rank, *buff_ptr);
+      return (buff_ptr);
+   }
+   
+   void CMPIManager::ReceiveCircularBuffer(MPI_Comm _comm, int _src_rank, CCircularBuffer & _cbuffer)
+   {
+      std::size_t data_size  = CMPIManager::GetReceivedDataSize(_comm, _src_rank);
+      std::size_t data_begin = _cbuffer.prepareNextDataPosition(data_size);
+      CMPIManager::Receive(_comm, _src_rank, _cbuffer.getData(data_begin));
+      _cbuffer.updateNbRequests(data_begin, data_begin + data_size);
+   }
+
+   // ---------------------- MÃ©moire (non fonctionnel ....) --------------------
+         
+   void CMPIManager::AllocMemory(void * _data, std::size_t _size)
+   {
+      if (MPI_Alloc_mem(sizeof(char) * _size, MPI_INFO_NULL, _data) != MPI_SUCCESS)
+         ERROR("CMPIManager::AllocMem(data, size)", << " MPI Error !");
+   }
+   
+   void CMPIManager::FreeMemory (void * _data)
+   {
+      MPI_Free_mem(_data);
+   }
+
+} // namespace comm
+} // namespace xmlioserver
+
Index: /XIOS/trunk/src/manager/mpi_manager.hpp
===================================================================
--- /XIOS/trunk/src/manager/mpi_manager.hpp	(revision 306)
+++ /XIOS/trunk/src/manager/mpi_manager.hpp	(revision 306)
@@ -0,0 +1,172 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#ifndef __MPI_INTERFACE_HPP__
+#define __MPI_INTERFACE_HPP__
+
+/**
+ * \file    mpi_interface.hpp
+ * \brief   Gestion des communications MPI via une surcouche interne (entÃªte).
+ * \author  HervÃ© Ozdoba
+ * \version 0.4
+ * \date    28 Juin 2011
+ */
+
+#ifndef __XIOS_NO_EXTERN
+
+// M(essage) P(assing) I(nterface) headers
+#include <mpi.h>
+
+// C++ standard headers
+#include <vector>
+
+#endif //__XIOS_NO_EXTERN
+
+// XMLIOServer headers
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+
+// ////////////////////////////// DÃ©clarations ///////////////////////////// //
+
+namespace xmlioserver
+{
+   /// \brief Espace de nommage pour les communications via la bibliothÃšque MPI.
+   namespace comm
+   {
+      typedef MPI_Fint     MPIComm; /*!< \brief Identifiant de communicateur MPI (Fortran).   */
+      typedef MPI_Fint    MPIGroup; /*!< \brief Identifiant de groupe MPI (Fortran).          */
+      typedef MPI_Fint  MPIRequest; /*!< \brief Identifiant de requÃªte MPI (Fortran).         */
+      typedef MPI_Fint  *MPIStatus; /*!< \brief Identifiant de statut MPI (Fortran).          */
+      typedef MPI_Fint MPIDataType; /*!< \brief Identifiant de type de donnÃ©es MPI (Fortran). */
+      
+      /**
+       * \class CMPIManager
+       * \brief Surcouche interne de la bibliÃ othÃšque M(essage) P(assing) I(nterface).
+       */
+      class CMPIManager
+      {
+         public : // Initialisation & Finalisation
+         
+            static void Initialise(int * argc, char *** argv);
+            static void InitialiseClient(int * argc, char *** argv);
+            static void InitialiseServer(int * argc, char *** argv);
+            static void Finalize(void);
+
+         public : // Communicateurs
+         
+         
+           
+            static inline MPI_Comm GetCommWorld(void)            
+            { return (MPI_COMM_WORLD); }
+            
+            static int GetCommRank(MPI_Comm _comm = MPI_COMM_WORLD);
+            static int GetCommSize(MPI_Comm _comm = MPI_COMM_WORLD);       
+            
+            static MPI_Comm CreateComm(MPI_Group _group, MPI_Comm _pcomm=MPI_COMM_WORLD);
+
+            static inline MPI_Comm GetCommClient(void) 
+            { return CommClient; }   
+            static inline MPI_Comm GetCommServer(void) 
+            { return CommServer; }   
+            static inline MPI_Comm GetCommClientServer(void)             
+            { return CommClientServer; }   
+            static inline int GetNbClient(void)             
+            { return NbClient; }   
+            static inline int GetNbServer(void)             
+            { return NbServer; }   
+
+            static inline bool IsConnected(void)             
+            { return (NbServer==0)?true:false; }   
+
+            static inline bool IsClient(void)             
+            { return _IsClient; }   
+
+            static inline bool IsServer(void)             
+            { return _IsServer; }   
+
+         public : // Autre
+         
+            static void Barrier(MPI_Comm _comm = MPI_COMM_WORLD);
+            
+            static bool DispatchClient(bool       _is_server,
+                                       MPI_Comm & _comm_client,
+                                       MPI_Comm & _comm_client_server,
+                                       MPI_Comm & _comm_server,
+                                       MPI_Comm _comm_parent);
+
+         public : // Groupes
+         
+            static MPI_Group GetGroupWorld(void);
+            static MPI_Group GetGroup(MPI_Comm Comm);
+            static MPI_Group CreateSubGroup(MPI_Group _pgroup, const std::vector<int> & _ranks);
+            static MPI_Group CreateSubGroup(MPI_Group _pgroup, int _min_rank, int _max_rank, int _intval = 1);
+
+         public : // Tests 
+         
+       
+         
+            static bool IsMaster(MPI_Comm _comm = MPI_COMM_WORLD);
+            static bool IsRank(int _rank, MPI_Comm _comm = MPI_COMM_WORLD);
+
+         public : // Communication simple
+         
+            static void Send (MPI_Comm _comm, int _dest_rank, char * _data,
+                              std::size_t _size, MPI_Request & _request);
+            static void Wait (MPI_Request & _request);
+            static bool Test (MPI_Request & _request);
+
+            
+            static bool HasReceivedData(MPI_Comm _comm, int _src_rank);
+            
+            static std::size_t GetReceivedDataSize(MPI_Comm _comm, int _src_rank);
+
+            static void Receive(MPI_Comm _comm, int _src_rank, char * _data);
+            
+            static void AllGather(int _indata, std::vector<int> & _outdata,
+                                  MPI_Comm _comm = MPI_COMM_WORLD);
+
+            static void AllGather(const std::vector<int> & _indata,
+                                        std::vector<int> & _outdata,
+                                  MPI_Comm _comm = MPI_COMM_WORLD);
+
+
+         public : // Communication 'complexe'
+         
+
+            static void SendLinearBuffer(MPI_Comm _comm, int _dest_rank, CLinearBuffer & _lbuffer, MPI_Request & _request);
+            static void ReceiveLinearBuffer(MPI_Comm _comm, int _src_rank, CLinearBuffer & _lbuffer);
+            static boost::shared_ptr<CLinearBuffer> ReceiveLinearBuffer(MPI_Comm _comm, int _src_rank);
+            static void ReceiveCircularBuffer(MPI_Comm _comm, int _src_rank, CCircularBuffer & _cbuffer);
+            
+            
+
+         public : // MÃ©moire (non fonctionnel ....)
+         
+            static void AllocMemory(void * _data, std::size_t _size);
+            static void FreeMemory (void * _data);
+         
+          private :
+          
+            static bool Initialized ;
+            static MPI_Comm CommClient ;
+            static MPI_Comm CommServer ;
+            static MPI_Comm CommClientServer ;
+            static int NbClient ;
+            static int NbServer ;
+
+            static bool _IsClient ;
+            static bool _IsServer ;
+            static bool using_server ;
+            static bool using_oasis ;
+            
+      }; // class CMPIManager
+      
+
+      
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif //__MPI_INTERFACE_HPP__
Index: /XIOS/trunk/src/manager/tree_manager.cpp
===================================================================
--- /XIOS/trunk/src/manager/tree_manager.cpp	(revision 306)
+++ /XIOS/trunk/src/manager/tree_manager.cpp	(revision 306)
@@ -0,0 +1,398 @@
+#include "tree_manager.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      void CTreeManager::SetCurrentContextId(const StdString & id)
+      {
+         CObjectFactory::SetCurrentContextId(id);
+         CGroupFactory::SetCurrentContextId(id);
+      }
+
+      boost::shared_ptr<CContext> CTreeManager::CreateContext(const StdString & id)
+      {
+         boost::shared_ptr<CContextGroup> group_context = CContext::GetContextGroup();
+         CTreeManager::SetCurrentContextId(id);
+         bool hasctxt = CObjectFactory::HasObject<CContext>(id);
+         
+         boost::shared_ptr<tree::CContext> context =
+               CObjectFactory::CreateObject<tree::CContext>(id);
+         if (!hasctxt) CGroupFactory::AddChild(group_context, context);
+
+#define DECLARE_NODE(Name_, name_) \
+   CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName());
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+
+         return (context);
+   }
+
+      //--------------------------------------------------------------
+      void CTreeManager::PrintTreeToFile(const StdString & path)
+      {
+         StdOFStream ofs(path.c_str());
+         CTreeManager::PrintTreeToStream(ofs);
+         ofs.close();
+      }
+
+      void CTreeManager::PrintTreeToString(StdString & content)
+      {
+         StdOStringStream ostrstream;
+         tree::CContext::ShowTree(ostrstream);
+         content.assign(CIndentedXml::Indented(ostrstream.str()));
+      }
+
+      void CTreeManager::PrintTreeToStream(StdOStream & out)
+      {
+         StdOStringStream ostrstream;
+         tree::CContext::ShowTree(ostrstream);
+         out << CIndentedXml::Indented(ostrstream.str());
+      }
+
+      //--------------------------------------------------------------
+
+      void CTreeManager::ParseFile(const StdString & filename)
+      { 
+         xml::CXMLParser::ParseFile(filename); 
+      }
+
+      void CTreeManager::ParseString(const StdString & xmlContent)
+      { 
+         xml::CXMLParser::ParseString(xmlContent); 
+      }
+
+      void CTreeManager::ParseStream(StdIStream & stream)
+      { 
+         xml::CXMLParser::ParseStream(stream); 
+      }
+      
+      //--------------------------------------------------------------
+      
+      void CTreeManager::ToBinary(StdOStream & os)
+      {
+         StdString currentContextId =
+            CObjectFactory::GetCurrentContextId();
+         std::vector<boost::shared_ptr<CContext> > def_vector =
+            CContext::GetContextGroup()->getChildList();
+            
+         const StdSize size = def_vector.size();         
+         const ENodeType cenum = CContext::GetType();
+         const ENodeType genum = CContextGroup::GetType();
+         
+         os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType)); 
+         os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
+         
+         for (StdSize i = 0; i < size; i++)
+         {
+            boost::shared_ptr<CContext> context = def_vector[i];         
+            CTreeManager::SetCurrentContextId(context->getId());                
+            const bool hid = context->hasId(); // Toujours vrai
+            
+            os.write (reinterpret_cast<const char*>(&cenum), sizeof(ENodeType));      
+            os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+            
+            if (hid)
+            {
+               const StdString & id = context->getId();
+               const StdSize size   = id.size();
+                  
+               os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize));
+               os.write (id.data(), size * sizeof(char));         
+            } 
+            
+            context->toBinary(os);
+         }
+         CTreeManager::SetCurrentContextId(currentContextId);          
+      }
+      
+      void CTreeManager::FromBinary(StdIStream & is)
+      {
+         StdSize ctxtnb = 0;
+         ENodeType renum = Unknown;
+         
+         boost::shared_ptr<CContextGroup> group_context =
+                           CContext::GetContextGroup();
+                           
+         is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));   
+         is.read (reinterpret_cast<char*>(&ctxtnb), sizeof(StdSize));
+
+         if (renum != CContextGroup::GetType())
+            ERROR("CTreeManager::FromBinary(StdIStream & is)",
+                  << "[ renum = " << renum << "] Bad type !");
+                  
+                  
+
+         for (StdSize i = 0; i < ctxtnb; i++)
+         {
+            bool hid = false;
+            is.read (reinterpret_cast<char*>(&renum), sizeof(tree::ENodeType));
+            is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+            
+            if (renum != CContext::GetType())
+               ERROR("CTreeManager::FromBinary(StdIStream & is)",
+                     << "[ renum = " << renum << "] Bad type !");
+                           
+            if (hid)
+            {
+               StdSize size  = 0;
+               is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+               StdString id(size, ' ');
+               is.read (const_cast<char *>(id.data()), size * sizeof(char));
+               
+               
+               CTreeManager::SetCurrentContextId(id);               
+               bool hasctxt = CObjectFactory::HasObject<CContext>(id);
+               
+               boost::shared_ptr<CContext> context =
+                  CObjectFactory::CreateObject<CContext>(id);
+                  
+               if (!hasctxt)
+                  CGroupFactory::AddChild(group_context, context);
+               context->fromBinary(is);
+            }
+         }
+      }
+      
+      void CTreeManager::FromBinary(StdString & str)
+      {
+         StdIStringStream istrs(str);
+         CTreeManager::FromBinary(istrs);
+      }
+            
+
+      //--------------------------------------------------------------
+      
+      void CTreeManager::DomainsToBinary  (StdOStream & os)
+      {
+         StdString currentContextId =
+            CObjectFactory::GetCurrentContextId();
+         std::vector<boost::shared_ptr<CContext> > def_vector =
+            CContext::GetContextGroup()->getChildList();
+            
+         const StdSize size = def_vector.size();         
+         const ENodeType cenum = CContext::GetType();
+         const ENodeType genum = CContextGroup::GetType();
+         const ENodeType denum = CDomain::GetType();
+         const ENodeType ienum = CGrid::GetType();
+         
+         os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType)); 
+         os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
+
+         for (StdSize i = 0; i < size; i++)
+         {
+            boost::shared_ptr<CContext> context = def_vector[i];         
+            CTreeManager::SetCurrentContextId(context->getId());                
+            const bool hid = context->hasId(); // Toujours vrai
+            
+            os.write (reinterpret_cast<const char*>(&cenum), sizeof(ENodeType));      
+            os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+            
+            if (hid)
+            {
+               const StdString & id = context->getId();
+               const StdSize size   = id.size();
+                  
+               os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize));
+               os.write (id.data(), size * sizeof(char));         
+            } 
+            
+            std::vector<boost::shared_ptr<CDomain> > & alldomain = 
+               CDomain::GetAllVectobject(context->getId());
+            std::vector<boost::shared_ptr<CGrid> > & allgrid = 
+               CGrid::GetAllVectobject(context->getId());
+               
+            const StdSize alldomain_size = alldomain.size(); 
+            const StdSize allgrid_size   = allgrid.size();
+            
+            os.write (reinterpret_cast<const char*>(&alldomain_size), sizeof(StdSize));
+            os.write (reinterpret_cast<const char*>(&allgrid_size), sizeof(StdSize));
+            
+            // Ãcriture successive des informations binaires de domaine.
+            for (StdSize j = 0; j < alldomain_size; j++)
+            {
+               boost::shared_ptr<CDomain> domain = alldomain[j];
+               bool hid = domain->hasId();
+               
+               os.write (reinterpret_cast<const char*>(&denum), sizeof(ENodeType)); 
+               os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+               
+               if (hid)
+               {
+                  const StdString & id = domain->getId();
+                  const StdSize idsize   = id.size();
+                     
+                  os.write (reinterpret_cast<const char*>(&idsize), sizeof(StdSize));
+                  os.write (id.data(), idsize * sizeof(char));  
+               }         
+               domain->toBinary(os);               
+            }
+            
+            // Ãcriture successive des informations binaires de grille.
+            for (StdSize j = 0; j < allgrid_size; j++)
+            {
+               boost::shared_ptr<CGrid> grid = allgrid[j];
+               bool hid = grid->hasId();
+               
+               os.write (reinterpret_cast<const char*>(&ienum), sizeof(ENodeType)); 
+               os.write (reinterpret_cast<const char*>(&hid), sizeof(bool));
+               
+               if (hid)
+               {
+                  const StdString & id = grid->getId();
+                  const StdSize idsize   = id.size();
+                     
+                  os.write (reinterpret_cast<const char*>(&idsize), sizeof(StdSize));
+                  os.write (id.data(), idsize * sizeof(char));         
+               }         
+               grid->toBinary(os);               
+            }
+         }
+         CTreeManager::SetCurrentContextId(currentContextId); 
+         
+      }
+      
+      void CTreeManager::DomainsFromBinary(StdIStream & is)
+      {
+         StdSize ctxtnb = 0;
+         ENodeType renum = Unknown;
+         
+         boost::shared_ptr<CContextGroup> group_context =
+                           CContext::GetContextGroup();
+         std::vector<boost::shared_ptr<CContext> > def_vector =
+            CContext::GetContextGroup()->getChildList();
+            
+         const StdSize size = def_vector.size();  
+                  
+         is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));   
+         is.read (reinterpret_cast<char*>(&ctxtnb), sizeof(StdSize));
+
+         if (renum != CContextGroup::GetType())
+            ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                  << "[ renum = " << renum << "] Bad type !");
+                  
+         if (size != ctxtnb)
+            ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                  << "[ size = " << size << "] != "<<ctxtnb<<" : Bad context group size !");
+                  
+         for (StdSize i = 0; i < ctxtnb; i++)
+         {
+            boost::shared_ptr<CContext> context = def_vector[i];
+            bool hid = false;
+            is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));
+            is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+            
+            if (renum != CContext::GetType())
+               ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                     << "[ renum = " << renum << "] Bad type !");
+                           
+            if (hid)
+            {
+               StdSize size  = 0;
+               is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+               StdString id(size, ' ');
+               is.read (const_cast<char *>(id.data()), size * sizeof(char));
+               
+               CTreeManager::SetCurrentContextId(id);
+            }
+            
+            std::vector<boost::shared_ptr<CDomain> > & alldomain = 
+               CDomain::GetAllVectobject(context->getId());
+            std::vector<boost::shared_ptr<CGrid> > & allgrid = 
+               CGrid::GetAllVectobject(context->getId());
+               
+            const StdSize allgrid_size = allgrid.size();
+            const StdSize alldomain_size = alldomain.size(); 
+            
+            StdSize read_alldomain_size = 0; 
+            StdSize read_allgrid_size = 0; 
+            
+            is.read (reinterpret_cast<char*>(&read_alldomain_size), sizeof(StdSize));
+            is.read (reinterpret_cast<char*>(&read_allgrid_size), sizeof(StdSize));
+            
+            if (alldomain_size != read_alldomain_size)
+               ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                     << "[ read_alldomain_size = " << read_alldomain_size 
+                     << "] Bad domain group size !");
+                     
+            if (alldomain_size != read_alldomain_size)
+               ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                     << "[ read_allgrid_size = " << read_allgrid_size 
+                     << "] Bad grid group size !");
+                     
+            // Lecture successive des informations binaires de domaine.
+              
+            for (StdSize j = 0; j < alldomain_size; j++)
+            {
+               boost::shared_ptr<CDomain> domain = alldomain[j];
+               bool hid = domain->hasId();
+               ENodeType rrenum = Unknown;
+               
+               is.read (reinterpret_cast<char*>(&rrenum), sizeof(ENodeType));
+               is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+               
+               if (rrenum != CDomain::GetType())
+                  ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                        << "[ rrenum = " << rrenum << "] Bad type !");
+
+               if (hid)
+               {
+                  StdSize size  = 0;
+                  is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+                  StdString id(size, ' ');
+                  is.read (const_cast<char *>(id.data()), size * sizeof(char));
+                  
+                  if (domain->getId().compare(id) != 0)
+                     ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                           << "[ id = " <<  id <<" != "<<domain->getId()<< "] Bad id !"); 
+               }
+               domain->fromBinary(is);
+            }
+            
+            // Lecture successive des informations binaires de grille.
+            for (StdSize j = 0; j < allgrid_size; j++)
+            {
+               boost::shared_ptr<CGrid> grid = allgrid[j];
+               bool hid = grid->hasId();
+               ENodeType rrenum = Unknown;
+               
+               is.read (reinterpret_cast<char*>(&rrenum), sizeof(ENodeType));
+               is.read (reinterpret_cast<char*>(&hid), sizeof(bool));
+               
+               if (rrenum != CGrid::GetType())
+                  ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                        << "[ rrenum = " << rrenum << "] Bad type !");
+
+               if (hid)
+               {
+                  StdSize size  = 0;
+                  is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+                  StdString id(size, ' ');
+                  is.read (const_cast<char *>(id.data()), size * sizeof(char));
+                  
+                  if (grid->getId().compare(id) != 0)
+                     ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)",
+                           << "[ id = " << id <<" != "<<grid->getId()<< "] Bad id !"); 
+               }
+               grid->fromBinary(is);
+            }
+            
+         }
+      }
+      
+      void CTreeManager::DomainsFromBinary(StdString & str)
+      {
+         StdIStringStream istrs(str);
+         CTreeManager::DomainsFromBinary(istrs);
+      }
+
+      ///-------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/manager/tree_manager.hpp
===================================================================
--- /XIOS/trunk/src/manager/tree_manager.hpp	(revision 306)
+++ /XIOS/trunk/src/manager/tree_manager.hpp	(revision 306)
@@ -0,0 +1,56 @@
+#ifndef __XMLIO_CTreeManager__
+#define __XMLIO_CTreeManager__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node_type.hpp"
+#include "xml_parser.hpp"
+#include "indent.hpp"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name)  , type * name = NULL
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CTreeManager
+      {
+         public :
+
+            /// Mutateurs ///
+            static void SetCurrentContextId(const StdString & id);
+            static boost::shared_ptr<CContext> CreateContext(const StdString & id = StdString(""));
+            
+            template<typename ObjType, typename AttType> // Pas encore implÃ©mentÃ©
+               static void SetAttribute(ObjType & obj, const StdString & attname, const AttType & attvalue);
+            template<typename ObjType, typename AttType> // Pas encore implÃ©mentÃ©
+               static void SetAttribute(const StdString & objname, const StdString & attname, const AttType & attvalue);
+
+            /// Sortie ///
+            static void PrintTreeToFile(const StdString & path);
+            static void PrintTreeToString(StdString & content);
+            static void PrintTreeToStream(StdOStream & out);
+
+            /// Parsing ///
+            static void ParseFile  (const StdString & filename);
+            static void ParseString(const StdString & xmlContent);
+            static void ParseStream(StdIStream & stream);
+            
+            /// Binaire ///
+            static void ToBinary  (StdOStream & os);
+            static void FromBinary(StdIStream & is);
+            static void FromBinary(StdString & str);
+            
+            static void DomainsToBinary  (StdOStream & os);
+            static void DomainsFromBinary(StdIStream & is);
+            static void DomainsFromBinary(StdString & str);
+
+      }; // class CTreeManager
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CTreeManager__
+
Index: /XIOS/trunk/src/manager/xios_manager.cpp
===================================================================
--- /XIOS/trunk/src/manager/xios_manager.cpp	(revision 306)
+++ /XIOS/trunk/src/manager/xios_manager.cpp	(revision 306)
@@ -0,0 +1,398 @@
+#include "xios_manager.hpp"
+
+#include "tree_manager.hpp"
+#include "data_treatment.hpp"
+#include "nc4_data_output.hpp"
+#include "attribute_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      
+      void CXIOSManager::Initialise(XIOSType type, int * argc, char *** argv)
+      {
+         CXIOSManager::Type = type;
+         if (type != CLIENT)
+         {
+            // Initialisation de la biliothÃšque MPI si nÃ©cessaire
+            comm::CMPIManager::InitialiseServer(argc, argv);
+            ExeName = StdString((*argv)[0]);
+            for (int i = 1; i < *argc; i++)
+               ExeOptions.push_back(StdString((*argv)[i]));
+         }
+      }
+
+      void CXIOSManager::Finalize(void)
+      {
+         if (CXIOSManager::Type != CLIENT)
+
+         {
+            // Finalisation de la biliothÃšque MPI si nÃ©cessaire
+            comm::CMPIManager::Finalize();
+         }
+      }
+
+      ///-------------------------------------------------------------
+
+      StdString CXIOSManager::ExeName("unknown");
+      std::vector<StdString> CXIOSManager::ExeOptions;
+
+      CXIOSManager::XIOSType   CXIOSManager::Type    = CLIENT;
+      CXIOSManager::XIOSStatus CXIOSManager::Status  = LOC_UNUSED;
+
+      StdString     CXIOSManager::ClientName("unknown name");
+      MPI_Comm CXIOSManager::Comm_Client_Server = MPI_COMM_NULL;
+      MPI_Comm CXIOSManager::Comm_Server = MPI_COMM_NULL;
+
+      xios_map<StdString, CXIOSManager::XIOSClient> CXIOSManager::Clients;
+
+      ///--------------------------------------------------------------
+      
+      void CXIOSManager::RunServer
+         (StdString clientName, MPI_Comm comm_client_server, MPI_Comm comm_server)
+      {
+         using namespace comm;
+         CXIOSManager::Comm_Client_Server = comm_client_server;
+         CXIOSManager::Comm_Server        = comm_server;
+         CXIOSManager::Status             = LOC_SERVER;
+         
+         // Reconstruction de l'arborescence d'objet Ã  l'aide des donnÃ©es envoyÃ©es par chacun des
+         // clients associÃ©s Ã  ce serveur.
+         std::vector<boost::shared_ptr<CLinearBuffer> > clientBuffer;
+         for (int i = 1; i < CMPIManager::GetCommSize(comm_client_server); i++)
+         {
+            while (!CMPIManager::HasReceivedData(comm_client_server, i)){}
+            clientBuffer.push_back(CMPIManager::ReceiveLinearBuffer(comm_client_server, i));
+         }
+         
+         // La quasi-totalitÃ© de l'arborescence est obtenue depuis les informations
+         // fournies par le client 1 du sous-groupe.
+/*         StdString main_data_tree = clientBuffer[0]->getString(0);        
+         tree::CTreeManager::FromBinary(main_data_tree);
+         
+         // Obtention des sous-domaines clients.
+         for (StdSize j = 1; j < clientBuffer.size(); j++)
+         {
+            main_data_tree = clientBuffer[j]->getString(0);
+            tree::CTreeManager::DomainsFromBinary(main_data_tree);
+         }
+*/
+
+         // Obtention des sous-domaines clients.
+         for (StdSize j = 0; j < clientBuffer.size(); j++)
+         {
+             StdString main_data_tree = clientBuffer[j]->getString(0);
+            tree::CTreeManager::FromBinary(main_data_tree);
+         }
+
+         
+         StdOStringStream osss;
+         osss << StdString("./def_server_next.")
+              << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+         CTreeManager::PrintTreeToFile(osss.str());
+
+         {  // Traitement de tous les contextes
+            StdString currentContextId = CObjectFactory::GetCurrentContextId();
+            std::vector<boost::shared_ptr<CContext> > def_vector =
+                                   CContext::GetContextGroup()->getChildList();
+            std::vector<boost::shared_ptr<CContext> >::iterator
+                               it = def_vector.begin(), end = def_vector.end();
+
+            //for (; it != end; it++ )
+            {
+               boost::shared_ptr<CContext> context = *it;
+               CTreeManager::SetCurrentContextId(context->getId());
+               boost::shared_ptr<data::CDataTreatment> dt(new data::CDataTreatment (context));
+               context->setDataTreatment(dt);
+               dt->createDataOutput<io::CNc4DataOutput>();
+            }
+            CTreeManager::SetCurrentContextId(currentContextId);
+         }
+        
+         StdOStringStream oss;
+         oss << StdString("./def_server_end.")
+             << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+         CTreeManager::PrintTreeToFile(oss.str());      
+ 
+      }
+      
+      //--------------------------------------------------------------
+      
+      void CXIOSManager::ShowInformation_CS(MPI_Comm comm_client_server)
+      {
+         using namespace comm;
+         typedef std::pair<StdString, XIOSClient> StdPairStrClient;
+         if (CMPIManager::IsMaster(comm_client_server))
+         {
+
+            xios_map<StdString, XIOSClient>::iterator
+               iit  = CXIOSManager::Clients.begin(),
+               eend = CXIOSManager::Clients.end();
+
+            for (;iit != eend; iit++)
+            {
+               const StdPairStrClient & elem = *iit;
+            }
+
+         }
+
+         comm::CMPIManager::Barrier(comm_client_server);
+         
+      }
+      
+      //--------------------------------------------------------------
+      
+      void CXIOSManager::RunClientServer(MPI_Comm comm_client_server)
+      {
+         using namespace comm;
+         typedef std::pair<StdString, XIOSClient> StdPairStrClient;
+         CXIOSManager::Comm_Client_Server = comm_client_server;
+         CXIOSManager::Comm_Server        = comm_client_server;
+         
+         CXIOSManager::ShowInformation_CS(comm_client_server);
+         
+         xios_map<StdString, XIOSClient>::iterator
+               iit  = CXIOSManager::Clients.begin(),
+               eend = CXIOSManager::Clients.end();
+         
+         StdSize start = 0, end   = 0;
+         
+         bool isClient = true, isIncl = false, isIncl_ = false;
+         MPI_Comm comm_client = 0, comm_client_grp = 0; comm_client_server = 0;
+
+         for (;iit != eend; iit++)
+         {
+            const StdPairStrClient & elem = *iit;
+
+            std::vector<int> clieindex, servindex ;
+            StdSize   currentRank      = CMPIManager::GetCommRank();
+            StdString clientName       = elem.first;
+            StdSize   nbClient         = elem.second.nbClient;
+            StdSize   nbClientPServer  = elem.second.nbClientPServer;
+            StdSize   nbServer         = (elem.second.nbClient)/(elem.second.nbClientPServer);
+
+            for (StdSize i = 0; i<nbServer; i++)
+            {
+               end = start + nbClientPServer;
+               MPI_Comm comm_  =  CMPIManager::CreateComm
+                  (CMPIManager::CreateSubGroup(CMPIManager::GetGroupWorld(), start, end));
+               MPI_Comm comm__ =  CMPIManager::CreateComm
+                  (CMPIManager::CreateSubGroup(CMPIManager::GetGroupWorld(), start+1, end));
+                  
+               servindex.push_back(start);
+               for (StdSize j = start+1; j <= end; j++)
+                  clieindex.push_back(j);
+                                
+               if ((currentRank >= start) && (currentRank <= end))
+               {
+                  comm_client_server = comm_;
+                  comm_client_grp    = comm__;
+                  isIncl = true;
+                  CXIOSManager::ClientName = clientName;
+                  CXIOSManager::Status = LOC_CLIENT;
+               }
+               if (currentRank == start)
+               {
+                  isClient = false; isIncl_  = true;
+                  CXIOSManager::Comm_Client_Server = comm_;
+                  CXIOSManager::Status = LOC_SERVER;
+               }               
+               if (clieindex.size() == nbClient)
+               {
+                  MPI_Comm comm___ = CMPIManager::CreateComm
+                  (CMPIManager::CreateSubGroup(CMPIManager::GetGroupWorld(), clieindex));
+                  if (isIncl) comm_client = comm___;
+                  clieindex.clear();
+                  isIncl = false;
+               }
+               
+               start = start + nbClientPServer + 1;
+            }
+            MPI_Comm comm____ = CMPIManager::CreateComm
+               (CMPIManager::CreateSubGroup(CMPIManager::GetGroupWorld(), servindex));
+            if (isIncl_) CXIOSManager::Comm_Server = comm____;               
+            servindex.clear();
+            isIncl_ = false;            
+         }
+         
+         if (isClient && (CXIOSManager::Clients.find(CXIOSManager::ClientName) !=
+                          CXIOSManager::Clients.end()))
+         {
+            CXIOSManager::Clients[CXIOSManager::ClientName].entry
+               (comm_client, comm_client_grp, comm_client_server);
+         }
+         else if(CXIOSManager::Clients.find(CXIOSManager::ClientName) !=
+                 CXIOSManager::Clients.end())
+         {
+            CXIOSManager::RunServer(CXIOSManager::ClientName, 
+                                    CXIOSManager::Comm_Client_Server,
+                                    CXIOSManager::Comm_Server);
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CXIOSManager::RunClient(bool launch, MPI_Comm comm_client)
+      {
+         if (launch)
+         {
+            CXIOSManager::Status       = LOC_CLIENT_SERVER;    
+            CXIOSManager::Comm_Server  = comm_client;    
+            (CXIOSManager::Clients.begin()->second.entry)
+               (comm_client, comm_client, comm_client);
+         }
+         else
+         {
+            CXIOSManager::Status  = LOC_CLIENT;
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      void CXIOSManager::AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer,
+                                   void (*entry_point)(MPI_Comm, MPI_Comm, MPI_Comm))
+      {
+         StdSize nbprocess  = comm::CMPIManager::GetCommSize(comm::CMPIManager::GetCommWorld());
+         StdSize nbprocess_used = CXIOSManager::GetNbClient() + CXIOSManager::GetNbServer();
+
+         if (nbClient < nbClientPServer)
+            ERROR("CXIOSManager::AddClient(...)", 
+                  << "nbClient < nbClientPServer");
+                  
+         if ((nbClient % nbClientPServer) != 0)
+            ERROR("CXIOSManager::AddClient(...)",
+                  << " (nbClient % nbClientPServer) != 0 !");
+                  
+         if ((nbprocess-nbprocess_used) < (nbClient + nbClient/nbClientPServer))
+            ERROR("CXIOSManager::AddClient(...)",
+                  << " Pas assez de processus disponibles !");
+                  
+         if (CXIOSManager::Clients.find(clientName) != CXIOSManager::Clients.end())
+            ERROR("CXIOSManager::AddClient(...)",
+                  << " Un client portant le mÃªme nom existe dÃ©jÃ  !");
+
+         XIOSClient client = {nbClient, nbClientPServer, entry_point };
+         CXIOSManager::Clients[clientName] = client;
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CXIOSManager::GetNbClient(void)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+            {
+               StdSize retvalue = 0;
+               typedef std::pair<StdString, XIOSClient> StdPairStrClient;
+               xios_map<StdString, XIOSClient>::iterator
+                  iit  = CXIOSManager::Clients.begin(),
+                  eend = CXIOSManager::Clients.end();
+
+               for (;iit != eend; iit++)
+               {
+                  const StdPairStrClient & elem = *iit;
+                  retvalue += CXIOSManager::GetNbLocClient(elem.first);
+               }
+               
+               return (retvalue);
+            }
+            case (CLIENT):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Server));
+            case (SERVER):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Client_Server) - 1);
+            default:
+               return (0);
+         }
+      }
+      
+      //---------------------------------------------------------------
+
+      StdSize CXIOSManager::GetNbLocClient(const StdString & clientName)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+               return (CXIOSManager::Clients[clientName].nbClient);
+            case (CLIENT):
+            case (SERVER):
+               return (CXIOSManager::GetNbClient());
+            default:
+               return (0);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CXIOSManager::GetNbServer(void)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+            {
+               StdSize retvalue = 0;
+               typedef std::pair<StdString, XIOSClient> StdPairStrClient;              
+
+               xios_map<StdString, XIOSClient>::iterator
+                  iit  = CXIOSManager::Clients.begin(),
+                  eend = CXIOSManager::Clients.end();
+
+               for (;iit != eend; iit++)
+               {
+                  const StdPairStrClient & elem = *iit;
+                  retvalue += CXIOSManager::GetNbLocServer(elem.first);
+               }                  
+                  
+               return (retvalue);
+            }
+            case (CLIENT):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Server));
+            case (SERVER):
+               return (1);
+            default:
+               return (0);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CXIOSManager::GetNbLocServer(const StdString & clientName)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+               return (CXIOSManager::Clients[clientName].nbClient /
+                       CXIOSManager::Clients[clientName].nbClientPServer);
+            case (CLIENT):
+            case (SERVER):
+               return (CXIOSManager::GetNbServer());
+            default:
+               return (0);
+         }
+      }
+      
+      //---------------------------------------------------------------
+      
+      CXIOSManager::XIOSType   CXIOSManager::GetType(void)
+      {
+         return (CXIOSManager::Type);
+      }
+      
+      //---------------------------------------------------------------
+      
+      CXIOSManager::XIOSStatus CXIOSManager::GetStatus(void)
+      {
+         return (CXIOSManager::Status);
+      }
+      
+      //---------------------------------------------------------------
+      
+      StdString  CXIOSManager::GetClientName(void)
+      {
+         return (CXIOSManager::ClientName);
+      }
+
+      ///--------------------------------------------------------------
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/manager/xios_manager.hpp
===================================================================
--- /XIOS/trunk/src/manager/xios_manager.hpp	(revision 306)
+++ /XIOS/trunk/src/manager/xios_manager.hpp	(revision 306)
@@ -0,0 +1,80 @@
+#ifndef __XMLIO_CXMLIOManager__
+#define __XMLIO_CXMLIOManager__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CXIOSManager
+   {
+      public :
+
+         /// DÃ©finition de type ///
+         typedef enum _xios_type
+         { CLIENT_SERVER = 0 , CLIENT, SERVER } XIOSType;
+         
+         typedef enum _xios_status
+         { LOC_UNUSED = 0, LOC_CLIENT, LOC_SERVER, LOC_CLIENT_SERVER }  XIOSStatus;
+
+         typedef struct
+         {
+            StdSize nbClient;
+            StdSize nbClientPServer;
+            void (*entry)(MPI_Comm, MPI_Comm, MPI_Comm) ;
+         } XIOSClient;
+         
+      public:
+
+         /// Initialisation et finalisation de la bibliothÃšque ///
+         static void Initialise(XIOSType type = CLIENT,
+                                int    * argc = NULL  ,
+                                char *** argv = NULL  );
+         static void Finalize(void);
+
+         /// Ajout de client en mode CLIENT_SERVER et CLIENT///
+         static void AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer,
+                               void (*entry_point)(MPI_Comm, MPI_Comm, MPI_Comm));
+
+         /// Lancement des serveurs et/ou des clients ///
+         static void RunServer(StdString clientName,MPI_Comm comm_client_server,MPI_Comm comm_server);
+         static void RunClient(bool launch = false, MPI_Comm comm_client = comm::CMPIManager::GetCommWorld());
+         static void RunClientServer(MPI_Comm comm_client_server = comm::CMPIManager::GetCommWorld());
+
+      public :
+
+         /// Accesseurs statiques ///
+         static XIOSType   GetType(void);
+         static XIOSStatus GetStatus(void);
+         static StdString  GetClientName(void);
+         
+      public :
+         
+         static StdSize GetNbClient(void);
+         static StdSize GetNbLocClient(const StdString & clientName = CXIOSManager::ClientName);
+
+         static StdSize GetNbServer(void);
+         static StdSize GetNbLocServer(const StdString & clientName = CXIOSManager::ClientName);
+         
+      public :
+      
+         /// Information ///
+         static void ShowInformation_CS(MPI_Comm comm_client_server);
+
+         /// Variables statiques privÃ©es ///
+         static StdString ExeName;
+         static std::vector<StdString> ExeOptions;
+
+         static XIOSType   Type;
+         static XIOSStatus Status;
+         static StdString  ClientName;
+         static MPI_Comm Comm_Client_Server, Comm_Server;
+         static xios_map<StdString, XIOSClient> Clients;
+
+   }; // class CXIOSManager
+} // namespace xmlioserver
+
+#endif //__XMLIO_CXMLIOManager__
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 306)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 306)
@@ -0,0 +1,66 @@
+#include "axis.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "transfert_parameters.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CAxis::CAxis(void)
+      : CObjectTemplate<CAxis>()
+      , CAxisAttributes(), isChecked(false), relFiles()
+   { /* Ne rien faire de plus */ }
+
+   CAxis::CAxis(const StdString & id)
+      : CObjectTemplate<CAxis>(id)
+      , CAxisAttributes(), isChecked(false), relFiles()
+   { /* Ne rien faire de plus */ }
+
+   CAxis::~CAxis(void)
+   { /* Ne rien faire de plus */ }
+
+   ///---------------------------------------------------------------
+
+   const std::set<StdString> & CAxis::getRelFiles(void) const
+   {
+      return (this->relFiles);
+   }
+
+   bool CAxis::IsWritten(const StdString & filename) const
+   {
+      return (this->relFiles.find(filename) != this->relFiles.end());
+   }
+
+   void CAxis::addRelFile(const StdString & filename)
+   {
+      this->relFiles.insert(filename);
+   }
+
+   //----------------------------------------------------------------
+
+   StdString CAxis::GetName(void)   { return (StdString("axis")); }
+   StdString CAxis::GetDefName(void){ return (CAxis::GetName()); }
+   ENodeType CAxis::GetType(void)   { return (eAxis); }
+
+   //----------------------------------------------------------------
+
+   void CAxis::checkAttributes(void)
+   {
+      if (this->isChecked) return;
+      StdSize size = this->size.getValue();
+      StdSize true_size = zvalue.getValue()->num_elements();
+      if (size != true_size)
+         ERROR("CAxis::checkAttributes(void)",
+               << "Le tableau \'zvalue\' a une taille diffÃ©rente de celle indiquÃ©e dans l'attribut \'size\'")
+
+      this->isChecked = true;
+   }
+
+   ///---------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 306)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 306)
@@ -0,0 +1,86 @@
+#ifndef __XMLIO_CAxis__
+#define __XMLIO_CAxis__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "declare_group.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CAxisGroup;
+   class CAxisAttributes;
+   class CAxis;
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CAxisAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
+#  include "axis_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CAxis)
+
+   ///--------------------------------------------------------------
+
+   class CAxis
+      : public CObjectTemplate<CAxis>
+      , public CAxisAttributes
+   {
+         /// typedef ///
+         typedef CObjectTemplate<CAxis>   SuperClass;
+         typedef CAxisAttributes SuperClassAttribute;
+
+      public :
+
+         typedef CAxisAttributes RelAttributes;
+         typedef CAxisGroup      RelGroup;
+
+         /// Constructeurs ///
+         CAxis(void);
+         explicit CAxis(const StdString & id);
+         CAxis(const CAxis & axis);       // Not implemented yet.
+         CAxis(const CAxis * const axis); // Not implemented yet.
+
+         /// Accesseurs ///
+         const std::set<StdString> & getRelFiles(void) const;
+
+         /// Test ///
+         bool IsWritten(const StdString & filename) const;
+
+         /// Mutateur ///
+         void addRelFile(const StdString & filename);
+
+         /// VÃ©rifications ///
+         void checkAttributes(void);
+
+         /// Destructeur ///
+         virtual ~CAxis(void);
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);
+         
+         static ENodeType GetType(void);
+
+      private :
+
+         bool isChecked;
+         std::set<StdString> relFiles;
+
+
+   }; // class CAxis
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CAxisGroup and CAxisDefinition
+   DECLARE_GROUP(CAxis);
+
+   ///--------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAxis__
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 306)
+++ /XIOS/trunk/src/node/context.cpp	(revision 306)
@@ -0,0 +1,582 @@
+#include "context.hpp"
+#include "tree_manager.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "calendar_type.hpp"
+#include "duration.hpp"
+
+#include "data_treatment.hpp"
+#include "context_client.hpp"
+#include "context_server.hpp"
+#include "nc4_data_output.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CContext::CContext(void)
+      : CObjectTemplate<CContext>(), CContextAttributes()
+      , calendar(),hasClient(false),hasServer(false)
+   { /* Ne rien faire de plus */ }
+
+   CContext::CContext(const StdString & id)
+      : CObjectTemplate<CContext>(id), CContextAttributes()
+      , calendar(),hasClient(false),hasServer(false)
+   { /* Ne rien faire de plus */ }
+
+   CContext::~CContext(void)
+   { 
+     if (hasClient) delete client ;
+     if (hasServer) delete server ;
+   }
+
+   //----------------------------------------------------------------
+
+   StdString CContext::GetName(void)   { return (StdString("context")); }
+   StdString CContext::GetDefName(void){ return (CContext::GetName()); }
+   ENodeType CContext::GetType(void)   { return (eContext); }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<CContextGroup> CContext::GetContextGroup(void)
+   {  
+      static boost::shared_ptr<CContextGroup> group_context
+                          (new CContextGroup(xml::CXMLNode::GetRootName()));
+      return (group_context); 
+   }
+   
+   //----------------------------------------------------------------
+   void CContext::setDataTreatment(boost::shared_ptr<data::CDataTreatment> ndatat)
+   {
+      this->datat = ndatat;
+   }
+
+   //----------------------------------------------------------------
+   boost::shared_ptr<data::CDataTreatment> CContext::getDataTreatment(void) const
+   {
+      return (this->datat);
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<date::CCalendar> CContext::getCalendar(void) const
+   {
+      return (this->calendar);
+   }
+   
+   //----------------------------------------------------------------
+   
+   void CContext::setCalendar(boost::shared_ptr<date::CCalendar> newCalendar)
+   {
+      this->calendar = newCalendar;
+      calendar_type.setValue(this->calendar->getId());
+      start_date.setValue(this->calendar->getInitDate().toString());
+   }
+   
+   //----------------------------------------------------------------
+
+   void CContext::solveCalendar(void)
+   {
+      if (this->calendar.get() != NULL) return;
+      if (calendar_type.isEmpty() || start_date.isEmpty())
+         ERROR(" CContext::solveCalendar(void)",
+               << "[ context id = " << this->getId() << " ] "
+               << "Impossible de dÃ©finir un calendrier (un attribut est manquant).");
+
+#define DECLARE_CALENDAR(MType  , mtype)                            \
+   if (calendar_type.getValue().compare(#mtype) == 0)               \
+   {                                                                \
+      this->calendar =  boost::shared_ptr<date::CCalendar>          \
+         (new date::C##MType##Calendar(start_date.getValue()));     \
+      if (!this->timestep.isEmpty())                                \
+       this->calendar->setTimeStep                                  \
+          (date::CDuration::FromString(this->timestep.getValue())); \
+      return;                                                       \
+   }
+#include "calendar_type.conf"
+
+      ERROR("CContext::solveCalendar(void)",
+            << "[ calendar_type = " << calendar_type.getValue() << " ] "
+            << "Le calendrier n'est pas dÃ©finie dans le code !");
+   }
+   
+   //----------------------------------------------------------------
+
+   void CContext::parse(xml::CXMLNode & node)
+   {
+      CContext::SuperClass::parse(node);
+
+      // PARSING POUR GESTION DES ENFANTS
+      xml::THashAttributes attributes = node.getAttributes();
+
+      if (attributes.end() != attributes.find("src"))
+      {
+         StdIFStream ifs ( attributes["src"].c_str() , StdIFStream::in );
+         if (!ifs.good())
+            ERROR("CContext::parse(xml::CXMLNode & node)",
+                  << "[ filename = " << attributes["src"] << " ] Bad xml stream !");
+         xml::CXMLParser::ParseInclude(ifs, *this);
+      }
+
+      if (node.getElementName().compare(CContext::GetName()))
+         DEBUG("Le noeud est mal nommÃ© mais sera traitÃ© comme un contexte !");
+
+      if (!(node.goToChildElement()))
+      {
+         DEBUG("Le context ne contient pas d'enfant !");
+      }
+      else
+      {
+         do { // Parcours des contextes pour traitement.
+
+            StdString name = node.getElementName();
+            attributes.clear();
+            attributes = node.getAttributes();
+
+            if (attributes.end() != attributes.find("id"))
+            { DEBUG(<< "Le noeud de dÃ©finition possÃšde un identifiant,"
+                    << " ce dernier ne sera pas pris en compte lors du traitement !"); }
+
+#define DECLARE_NODE(Name_, name_)    \
+   if (name.compare(C##Name_##Definition::GetDefName()) == 0) \
+   { CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) -> parse(node); \
+   continue; }
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+
+            DEBUG(<< "L'Ã©lÃ©ment nommÃ© \'"     << name
+                  << "\' dans le contexte \'" << CObjectFactory::GetCurrentContextId()
+                  << "\' ne reprÃ©sente pas une dÃ©finition !");
+
+         } while (node.goToNextElement());
+
+         node.goToParentElement(); // Retour au parent
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void CContext::ShowTree(StdOStream & out)
+   {
+      StdString currentContextId =
+         CObjectFactory::GetCurrentContextId();
+      std::vector<boost::shared_ptr<CContext> > def_vector =
+         CContext::GetContextGroup()->getChildList();
+      std::vector<boost::shared_ptr<CContext> >::iterator
+         it = def_vector.begin(), end = def_vector.end();
+
+      out << "<? xml version=\"1.0\" ?>" << std::endl;
+      out << "<"  << xml::CXMLNode::GetRootName() << " >" << std::endl;
+      
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<CContext> context = *it;         
+         CTreeManager::SetCurrentContextId(context->getId());         
+         out << *context << std::endl;
+      }
+      
+      out << "</" << xml::CXMLNode::GetRootName() << " >" << std::endl;
+      CTreeManager::SetCurrentContextId(currentContextId);  
+   }
+   
+   //----------------------------------------------------------------
+   
+   void CContext::toBinary(StdOStream & os) const
+   {
+      SuperClass::toBinary(os);
+       
+#define DECLARE_NODE(Name_, name_)                                         \
+   {                                                                       \
+      ENodeType renum = C##Name_##Definition::GetType();                   \
+      bool val = CObjectFactory::HasObject<C##Name_##Definition>           \
+                     (C##Name_##Definition::GetDefName());                 \
+      os.write (reinterpret_cast<const char*>(&renum), sizeof(ENodeType)); \
+      os.write (reinterpret_cast<const char*>(&val), sizeof(bool));        \
+      if (val) CObjectFactory::GetObject<C##Name_##Definition>             \
+                     (C##Name_##Definition::GetDefName())->toBinary(os);   \
+   }   
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+   }
+   
+   //----------------------------------------------------------------
+   
+   void CContext::fromBinary(StdIStream & is)
+   {
+      SuperClass::fromBinary(is);
+#define DECLARE_NODE(Name_, name_)                                         \
+   {                                                                       \
+      bool val = false;                                                    \
+      ENodeType renum = Unknown;                                           \
+      is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));        \
+      is.read (reinterpret_cast<char*>(&val), sizeof(bool));               \
+      if (renum != C##Name_##Definition::GetType())                        \
+         ERROR("CContext::fromBinary(StdIStream & is)",                    \
+               << "[ renum = " << renum << "] Bad type !");                \
+      if (val) CObjectFactory::CreateObject<C##Name_##Definition>          \
+                   (C##Name_##Definition::GetDefName()) -> fromBinary(is); \
+   }   
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+      
+   }
+   
+   
+   //----------------------------------------------------------------
+
+   StdString CContext::toString(void) const
+   {
+      StdOStringStream oss;
+      oss << "<" << CContext::GetName()
+          << " id=\"" << this->getId() << "\" "
+          << SuperClassAttribute::toString() << ">" << std::endl;
+      if (!this->hasChild())
+      {
+         //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrÃ©mentation
+      }
+      else
+      {
+
+#define DECLARE_NODE(Name_, name_)    \
+   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \
+   oss << *CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) << std::endl;
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+
+      }
+
+      oss << "</" << CContext::GetName() << " >";
+
+      return (oss.str());
+   }
+
+   //----------------------------------------------------------------
+
+   void CContext::solveDescInheritance(const CAttributeMap * const UNUSED(parent))
+   {
+#define DECLARE_NODE(Name_, name_)    \
+   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \
+   CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())->solveDescInheritance();
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+   }
+
+   //----------------------------------------------------------------
+
+   bool CContext::hasChild(void) const
+   {
+      return (
+#define DECLARE_NODE(Name_, name_)    \
+   CObjectFactory::HasObject<C##Name_##Definition>  (C##Name_##Definition::GetDefName())   ||
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+      false);
+}
+
+   //----------------------------------------------------------------
+
+   void CContext::solveFieldRefInheritance(void)
+   {
+      if (!this->hasId()) return;
+      std::vector<boost::shared_ptr<CField> > allField
+               = CObjectTemplate<CField>::GetAllVectobject(this->getId());
+      std::vector<boost::shared_ptr<CField> >::iterator 
+         it = allField.begin(), end = allField.end();
+            
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<CField> field = *it;
+         field->solveRefInheritance();
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void CContext::CleanTree(void)
+   {
+#define DECLARE_NODE(Name_, name_) C##Name_##Group::ClearAllAttributes();
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "node_type.conf"
+   }
+   ///---------------------------------------------------------------
+   
+   void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm)
+   {
+     hasClient=true ;
+     client = new CContextClient(this,intraComm, interComm) ;
+   } 
+
+   void CContext::initServer(MPI_Comm intraComm,MPI_Comm interComm)
+   {
+     hasServer=true ;
+     server = new CContextServer(this,intraComm,interComm) ;
+   } 
+
+   bool CContext::eventLoop(void)
+   {
+     return server->eventLoop() ;
+   } 
+   
+   void CContext::finalize(void)
+   {
+      if (hasClient && !hasServer)
+      {
+         client->finalize() ;
+      }
+      if (hasServer)
+      {
+        closeAllFile() ;
+      }
+   }
+       
+       
+ 
+   
+   void CContext::closeDefinition(void)
+   {
+      if (hasClient && !hasServer) sendCloseDefinition() ;
+      
+      solveCalendar();         
+         
+      // RÃ©solution des hÃ©ritages pour le context actuel.
+      this->solveAllInheritance();
+
+      //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
+      this->findEnabledFiles();
+
+      //Recherche des champs Ã  sortir (enable Ã  true + niveau de sortie correct)
+      // pour chaque fichier prÃ©cÃ©demment listÃ©.
+      this->findAllEnabledFields();
+
+      // RÃ©solution des rÃ©fÃ©rences de grilles pour chacun des champs.
+      this->solveAllGridRef();
+
+      // Traitement des opÃ©rations.
+      this->solveAllOperation();
+
+      // Nettoyage de l'arborescence
+      CleanTree();
+      if (hasClient) sendCreateFileHeader() ;
+   }
+   
+   void CContext::findAllEnabledFields(void)
+   {
+     for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+     (void)this->enabledFiles[i]->getEnabledFields();
+   }
+
+   void CContext::solveAllGridRef(void)
+   {
+     for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+     this->enabledFiles[i]->solveEFGridRef();
+   }
+
+   void CContext::solveAllOperation(void)
+   {
+      for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+      this->enabledFiles[i]->solveEFOperation();
+   }
+
+   void CContext::solveAllInheritance(void)
+   {
+     // RÃ©solution des hÃ©ritages descendants (cÃ d des hÃ©ritages de groupes)
+     // pour chacun des contextes.
+      solveDescInheritance();
+
+     // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence au niveau des fichiers.
+      const std::vector<boost::shared_ptr<CFile> > & allFiles
+             = CObjectFactory::GetObjectVector<CFile>();
+
+      for (unsigned int i = 0; i < allFiles.size(); i++)
+         allFiles[i]->solveFieldRefInheritance();
+   }
+
+   void CContext::findEnabledFiles(void)
+   {
+      const std::vector<boost::shared_ptr<CFile> > & allFiles
+          = CObjectFactory::GetObjectVector<CFile>();
+
+      for (unsigned int i = 0; i < allFiles.size(); i++)
+         if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dÃ©fini.
+            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixÃ© Ã  vrai.
+               enabledFiles.push_back(allFiles[i]);
+
+      if (enabledFiles.size() == 0)
+         DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
+               << getId() << "\" !");
+   }
+
+   void CContext::closeAllFile(void)
+   {
+     std::vector<boost::shared_ptr<CFile> >::const_iterator
+            it = this->enabledFiles.begin(), end = this->enabledFiles.end();
+         
+     for (; it != end; it++)
+     {
+       info(30)<<"Closing File : "<<(*it)->getId()<<endl;
+       (*it)->close();
+     }
+   }
+   
+   bool CContext::dispatchEvent(CEventServer& event)
+   {
+      
+      if (SuperClass::dispatchEvent(event)) return true ;
+      else
+      {
+        switch(event.type)
+        {
+           case EVENT_ID_CLOSE_DEFINITION :
+             recvCloseDefinition(event) ;
+             return true ;
+             break ;
+           case EVENT_ID_UPDATE_CALENDAR :
+             recvUpdateCalendar(event) ;
+             return true ;
+             break ;
+           case EVENT_ID_CREATE_FILE_HEADER :
+             recvCreateFileHeader(event) ;
+             return true ;
+             break ;
+           default :
+             ERROR("bool CContext::dispatchEvent(CEventServer& event)",
+                    <<"Unknown Event") ;
+           return false ;
+         }
+      }
+   }
+   
+   void CContext::sendCloseDefinition(void)
+   {
+
+     CEventClient event(getType(),EVENT_ID_CLOSE_DEFINITION) ;   
+     if (client->isServerLeader())
+     {
+       CMessage msg ;
+       msg<<this->getId() ;
+       event.push(client->getServerLeader(),1,msg) ;
+       client->sendEvent(event) ;
+     }
+     else client->sendEvent(event) ;
+   }
+   
+   void CContext::recvCloseDefinition(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->closeDefinition() ;
+   }
+   
+   void CContext::sendUpdateCalendar(int step)
+   {
+     if (!hasServer)
+     {
+       CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId()<<step ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+     }
+   }
+   
+   void CContext::recvUpdateCalendar(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvUpdateCalendar(*buffer) ;
+   }
+   
+   void CContext::recvUpdateCalendar(CBufferIn& buffer)
+   {
+      int step ;
+      buffer>>step ;
+      updateCalendar(step) ;
+   }
+   
+   void CContext::sendCreateFileHeader(void)
+   {
+
+     CEventClient event(getType(),EVENT_ID_CREATE_FILE_HEADER) ;   
+     if (client->isServerLeader())
+     {
+       CMessage msg ;
+       msg<<this->getId() ;
+       event.push(client->getServerLeader(),1,msg) ;
+       client->sendEvent(event) ;
+     }
+     else client->sendEvent(event) ;
+   }
+   
+   void CContext::recvCreateFileHeader(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvCreateFileHeader(*buffer) ;
+   }
+   
+   void CContext::recvCreateFileHeader(CBufferIn& buffer)
+   {
+      createFileHeader() ;
+   }
+   
+   void CContext::updateCalendar(int step)
+   {
+      calendar->update(step) ;
+   }
+ 
+   void CContext::createFileHeader(void )
+   {
+      vector<shared_ptr<CFile> >::const_iterator it ;
+         
+      for (it=enabledFiles.begin(); it != enabledFiles.end(); it++)
+      {
+/*         shared_ptr<CFile> file = *it;
+         StdString filename = (!file->name.isEmpty()) ?   file->name.getValue() : file->getId();
+         StdOStringStream oss;
+         if (! output_dir.isEmpty()) oss << output_dir.getValue();
+         oss << filename;
+         if (!file->name_suffix.isEmpty()) oss << file->name_suffix.getValue();
+
+         bool multifile=true ;
+         if (!file->type.isEmpty())
+         {
+           StdString str=file->type.getValue() ; 
+           if (str.compare("one_file")==0) multifile=false ;
+           else if (str.compare("multi_file")==0) multifile=true ;
+           else ERROR("void Context::createDataOutput(void)",
+                      "incorrect file <type> attribut : must be <multi_file> or <one_file>, "
+                      <<"having : <"<<str<<">") ;
+         } 
+         if (multifile) 
+         {
+            if (server->intraCommSize > 1) oss << "_" << server->intraCommRank;
+         }
+         oss << ".nc";
+
+         shared_ptr<io::CDataOutput> dout(new T(oss.str(), false,server->intraComm,multifile));
+*/
+         (*it)->createHeader();
+      }
+   } 
+   
+   shared_ptr<CContext> CContext::current(void)
+   {
+     return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+   }
+   
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/context.hpp
===================================================================
--- /XIOS/trunk/src/node/context.hpp	(revision 306)
+++ /XIOS/trunk/src/node/context.hpp	(revision 306)
@@ -0,0 +1,168 @@
+#ifndef __XMLIO_CContext__
+#define __XMLIO_CContext__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node_type.hpp"
+#include "calendar.hpp"
+
+#include "declare_group.hpp"
+//#include "context_client.hpp"
+//#include "context_server.hpp"
+#include "data_output.hpp"
+
+#include <mpi.h>
+
+namespace xmlioserver {
+namespace data {
+    class CDataTreatment;
+} // namespace tree
+} // namespace xmlioserver
+
+namespace xmlioserver {
+   class CContextClient ;
+   class CContextServer ;
+   
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CContextGroup;
+   class CContextAttributes;
+   class CContext;
+  
+   ///--------------------------------------------------------------
+
+   // Declare/Define CFileAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CContext)
+#  include "context_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CContext)
+
+   ///--------------------------------------------------------------
+
+   class CContext
+      : public CObjectTemplate<CContext>
+      , public CContextAttributes
+   {
+         public :
+         enum EEventId
+         {
+           EVENT_ID_CLOSE_DEFINITION,EVENT_ID_UPDATE_CALENDAR,
+           EVENT_ID_CREATE_FILE_HEADER,EVENT_ID_CONTEXT_FINALIZE
+         } ;
+         
+         /// typedef ///
+         typedef CObjectTemplate<CContext>   SuperClass;
+         typedef CContextAttributes SuperClassAttribute;
+
+      public :
+
+         typedef CContextAttributes RelAttributes;
+         typedef CContext           RelGroup;
+
+         //---------------------------------------------------------
+
+      public :
+
+         /// Constructeurs ///
+         CContext(void);
+         explicit CContext(const StdString & id);
+         CContext(const CContext & context);       // Not implemented yet.
+         CContext(const CContext * const context); // Not implemented yet.
+
+         /// Destructeur ///
+         virtual ~CContext(void);
+
+         //---------------------------------------------------------
+
+      public :
+      
+         /// Mutateurs ///
+         void setCalendar(boost::shared_ptr<date::CCalendar> newCalendar);
+         void setDataTreatment(boost::shared_ptr<data::CDataTreatment> datat);
+      
+         /// Accesseurs ///
+         boost::shared_ptr<date::CCalendar>      getCalendar(void) const;
+         boost::shared_ptr<data::CDataTreatment> getDataTreatment(void) const;
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);         
+         static ENodeType GetType(void);         
+
+         static boost::shared_ptr<CContextGroup> GetContextGroup(void);
+
+      public :
+
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+         void solveFieldRefInheritance(void);
+         void solveCalendar(void);
+
+         /// Autres mÃ©thodes statiques ///
+         static void ShowTree(StdOStream & out = std::clog);
+         static void CleanTree(void);
+
+         /// Test ///
+         virtual bool hasChild(void) const;
+
+         bool eventLoop(void) ;
+         bool serverLoop(void) ;
+         void clientLoop(void) ;
+         void initServer(MPI_Comm intraComm, MPI_Comm interComm) ;
+         void initClient(MPI_Comm intraComm, MPI_Comm interComm) ;
+         CContextServer* server ;
+         CContextClient* client ;
+         bool hasClient ;
+         bool hasServer ;
+         void finalize(void) ;
+         void closeDefinition(void) ;
+         void findAllEnabledFields(void);
+         void solveAllGridRef(void);
+         void solveAllOperation(void);
+         void solveAllInheritance(void) ;
+         void findEnabledFiles(void);
+         void closeAllFile(void) ;
+         void updateCalendar(int step) ;
+         void createFileHeader(void ) ;
+      // dispatch event
+         static bool dispatchEvent(CEventServer& event) ;
+         void sendCloseDefinition(void) ;
+         void sendUpdateCalendar(int step) ;
+         void sendCreateFileHeader(void) ;
+         static void recvUpdateCalendar(CEventServer& event) ;
+         void recvUpdateCalendar(CBufferIn& buffer) ;
+         static void recvCloseDefinition(CEventServer& event) ;
+         static void recvCreateFileHeader(CEventServer& event) ;
+         void recvCreateFileHeader(CBufferIn& buffer) ;
+         static shared_ptr<CContext> current(void) ;
+         
+      public :
+      
+         /// Autres ///
+         virtual void parse(xml::CXMLNode & node);
+
+         virtual StdString toString(void) const;
+         virtual void toBinary  (StdOStream & os) const;
+         virtual void fromBinary(StdIStream & is);
+         
+      public :
+      
+         boost::shared_ptr<date::CCalendar>      calendar;
+         boost::shared_ptr<data::CDataTreatment> datat;
+ 
+         std::vector<boost::shared_ptr<CFile> > enabledFiles;
+
+
+   }; // class CContext
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CContextGroup and CContextDefinition
+   DECLARE_GROUP(CContext);
+
+   ///--------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CContext__
Index: /XIOS/trunk/src/node/domain.cpp
===================================================================
--- /XIOS/trunk/src/node/domain.cpp	(revision 306)
+++ /XIOS/trunk/src/node/domain.cpp	(revision 306)
@@ -0,0 +1,1073 @@
+#include "domain.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "mpi_manager.hpp"
+
+#include "tree_manager.hpp"
+#include "xmlioserver_spl.hpp"
+#include "event_client.hpp"
+#include "event_server.hpp"
+#include "buffer_in.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CDomain::CDomain(void)
+      : CObjectTemplate<CDomain>(), CDomainAttributes()
+      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
+      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
+      , ibegin_zoom_sub(), jbegin_zoom_sub(), ni_zoom_sub(), nj_zoom_sub()
+      , lonvalue_sub(), latvalue_sub(),lonvalue_srv(new CArray<double,1>())
+      , latvalue_srv(new CArray<double,1>())
+   { /* Ne rien faire de plus */ }
+
+   CDomain::CDomain(const StdString & id)
+      : CObjectTemplate<CDomain>(id), CDomainAttributes()
+      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
+      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
+      , ibegin_zoom_sub(), jbegin_zoom_sub(),ni_zoom_sub(), nj_zoom_sub()
+      , lonvalue_sub(), latvalue_sub(),lonvalue_srv(new CArray<double,1>())
+      , latvalue_srv(new CArray<double,1>())
+   { /* Ne rien faire de plus */ }
+
+   CDomain::~CDomain(void)
+   { 
+      this->local_mask.reset();
+      for (StdSize i = 0; i < this->lonvalue_sub.size(); i++)
+      {
+         this->lonvalue_sub[i].reset();
+         this->latvalue_sub[i].reset();
+      }     
+   }
+
+   ///---------------------------------------------------------------
+
+   const std::set<StdString> & CDomain::getRelFiles(void) const
+   {
+      return (this->relFiles);
+   }
+
+   //----------------------------------------------------------------
+   
+   bool CDomain::hasZoom(void) const
+   {
+      return ((this->zoom_ni.getValue() != this->ni_glo.getValue()) && 
+              (this->zoom_nj.getValue() != this->nj_glo.getValue()));
+   }
+   
+   //----------------------------------------------------------------
+   
+   bool CDomain::isEmpty(void) const
+   {
+      return ((this->zoom_ni_srv == 0) || 
+              (this->zoom_nj_srv == 0));
+   }
+
+   //----------------------------------------------------------------
+
+   bool CDomain::IsWritten(const StdString & filename) const
+   {
+      return (this->relFiles.find(filename) != this->relFiles.end());
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::addRelFile(const StdString & filename)
+   {
+      this->relFiles.insert(filename);
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::fromBinary(StdIStream & is)
+   {
+      SuperClass::fromBinary(is);
+      
+      if ( !this->ibegin.isEmpty()   &&
+           !this->jbegin.isEmpty()   &&
+           !this->iend.isEmpty()     &&
+           !this->jend.isEmpty()     &&
+           !this->latvalue.isEmpty() &&
+           !this->lonvalue.isEmpty())
+      {
+      
+         this->ibegin_sub.push_back(this->ibegin.getValue());
+         this->jbegin_sub.push_back(this->jbegin.getValue());
+         this->iend_sub.push_back(this->iend.getValue());
+         this->jend_sub.push_back(this->jend.getValue()); 
+         
+         this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue());
+         this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue());
+         this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue());
+         this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
+      
+         this->latvalue_sub.push_back(this->latvalue.getValue());
+         this->lonvalue_sub.push_back(this->lonvalue.getValue());
+      }
+      
+#define CLEAR_ATT(name_)\
+      SuperClassAttribute::operator[](#name_)->clear()
+
+         CLEAR_ATT(mask);
+         CLEAR_ATT(data_n_index);
+         CLEAR_ATT(data_i_index);
+         CLEAR_ATT(data_j_index);
+         
+         CLEAR_ATT(data_ni);
+         CLEAR_ATT(data_nj);
+         CLEAR_ATT(data_ibegin);
+         CLEAR_ATT(data_jbegin);
+         
+         CLEAR_ATT(ni);
+         CLEAR_ATT(nj);
+         
+#undef CLEAR_ATT
+
+      if ( !this->ibegin.isEmpty()   &&
+           !this->jbegin.isEmpty()   &&
+           !this->iend.isEmpty()     &&
+           !this->jend.isEmpty()     &&
+           !this->latvalue.isEmpty() &&
+           !this->lonvalue.isEmpty())
+      {
+
+         this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end()));
+         this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end()));
+         this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end()));
+         this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end()));
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   StdString CDomain::GetName(void)   { return (StdString("domain")); }
+   StdString CDomain::GetDefName(void){ return (CDomain::GetName()); }
+   ENodeType CDomain::GetType(void)   { return (eDomain); }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkGlobalDomain(void)
+   {
+      if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
+          (nj_glo.isEmpty() || nj_glo.getValue() <= 0 ))
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "[ Id = " << this->getId() << " ] "
+               << "Le domaine global est mal dÃ©fini,"
+               << " vÃ©rifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") 
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkLocalIDomain(void)
+   {
+      if (!ni.isEmpty() && !ibegin.isEmpty() && iend.isEmpty())
+         iend.setValue(ibegin.getValue() + ni.getValue() - 1) ;
+
+      else if (!ni.isEmpty() && !iend.isEmpty()   && ibegin.isEmpty())
+         ibegin.setValue( - ni.getValue() + iend.getValue() + 1) ;
+
+      else if (!ibegin.isEmpty() && !iend.isEmpty() && ni.isEmpty())
+         ni.setValue(iend.getValue() - ibegin.getValue() + 1) ;
+
+      else if (!ibegin.isEmpty() && !iend.isEmpty() &&
+               !ni.isEmpty() && (iend.getValue() != ibegin.getValue() + ni.getValue() - 1))
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Le domaine est mal dÃ©fini,"
+               << " iend est diffÃ©rent de (ibegin + ni - 1) !") ;
+      }
+      else
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Le domaine est mal dÃ©fini,"
+               << " deux valeurs au moins parmis iend, ibegin, ni doivent Ãªtre dÃ©finies !") ;
+      }
+
+
+      if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() ||
+          ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue())
+         ERROR("CDomain::checkAttributes(void)",
+               << "[ Id = " << this->getId() << " ] "
+               << "Domaine local mal dÃ©fini,"
+               << " vÃ©rifiez les valeurs ni, ni_glo, ibegin, iend") ;
+
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkLocalJDomain(void)
+   {
+      if (!nj.isEmpty() && !jbegin.isEmpty() && jend.isEmpty())
+         jend.setValue(jbegin.getValue() + nj.getValue() - 1) ;
+
+      else if (!nj.isEmpty() && !jend.isEmpty() && jbegin.isEmpty())
+         jbegin.setValue( - nj.getValue() + jend.getValue() + 1) ;
+
+      else if (!jbegin.isEmpty() && !jend.isEmpty() && nj.isEmpty())
+         nj.setValue(jend.getValue() - jbegin.getValue() + 1) ;
+
+      else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() &&
+               (jend.getValue() != jbegin.getValue() + nj.getValue() - 1))
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Le domaine est mal dÃ©fini,"
+               << " iend est diffÃ©rent de (jbegin + nj - 1) !") ;
+      }
+      else
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Le domaine est mal dÃ©fini,"
+               << " deux valeurs au moins parmis jend, jbegin, nj doivent Ãªtre dÃ©finies !") ;
+      }
+
+      if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() ||
+          jbegin.getValue() < 1 || jend.getValue() > nj_glo.getValue())
+         ERROR("CDomain::checkAttributes(void)",
+               << "Domaine local mal dÃ©fini,"
+               << " vÃ©rifiez les valeurs nj, nj_glo, jbegin, jend") ;
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkMask(void)
+   {
+      using namespace std;
+      
+      int ibegin_mask = 0,
+          jbegin_mask = 0,
+          iend_mask = iend.getValue() - ibegin.getValue(),
+          jend_mask = jend.getValue() - jbegin.getValue();
+      
+      if (!zoom_ibegin.isEmpty())
+      {
+         int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
+         int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+         
+         ibegin_mask = max (ibegin.getValue(), zoom_ibegin.getValue());
+         jbegin_mask = max (jbegin.getValue(), zoom_jbegin.getValue());
+         iend_mask   = min (iend.getValue(), zoom_iend);
+         jend_mask   = min (jend.getValue(), zoom_jend);
+                 
+         ibegin_mask -= ibegin.getValue();
+         jbegin_mask -= jbegin.getValue();
+         iend_mask   -= ibegin.getValue();
+         jend_mask   -= jbegin.getValue();
+      }
+      
+
+      if (!mask.isEmpty())
+      {
+         ARRAY(bool, 2) mask_ = mask.getValue();
+         unsigned int niu = ni.getValue(), nju = nj.getValue();
+         if ((mask_->shape()[0] != niu) ||
+             (mask_->shape()[1] != nju))
+            ERROR("CDomain::checkAttributes(void)",
+                  <<"Le masque n'a pas la mÃªme taille que le domaine local") ;
+                  
+         for (int i = 0; i < ni.getValue(); i++)
+         {
+            for (int j = 0; j < nj.getValue(); j++)
+            {
+               if (i < ibegin_mask && i > iend_mask &&
+                   j < jbegin_mask && j > jend_mask )
+                     (*mask_)[i][j] = false;
+            }
+         }
+      }
+      else // (!mask.hasValue())
+      { // Si aucun masque n'est dÃ©fini,
+        // on en crÃ©e un nouveau qui valide l'intÃ©gralitÃ© du domaine.
+         ARRAY_CREATE(__arr, bool, 2, [ni.getValue()][nj.getValue()]);
+         for (int i = 0; i < ni.getValue(); i++)
+         {
+            for (int j = 0; j < nj.getValue(); j++)
+            {
+               if (i >= ibegin_mask && i <= iend_mask &&
+                   j >= jbegin_mask && j <= jend_mask )
+                     (*__arr)[i][j] = true;
+               else  (*__arr)[i][j] = false;
+            }
+         }
+               
+         mask.setValue(__arr);
+         __arr.reset();
+      }
+   }
+
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkDomainData(void)
+   {     
+      if (!data_dim.isEmpty() &&
+         !(data_dim.getValue() == 1 || data_dim.getValue() == 2))
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Dimension des donnÃ©es non comptatible (doit Ãªtre 1 ou 2) !") ;
+      }
+      else if (data_dim.isEmpty())
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Dimension des donnÃ©es non dÃ©finie !") ;
+      }
+
+      if (data_ibegin.isEmpty())
+         data_ibegin.setValue(0) ;
+      if (data_jbegin.isEmpty() && (data_dim.getValue() == 2))
+         data_jbegin.setValue(0) ;
+
+      if (!data_ni.isEmpty() && (data_ni.getValue() <= 0))
+      {
+         ERROR("CDomain::checkAttributes(void)",
+               << "Dimension des donnÃ©es nÃ©gative (data_ni).") ;
+      }
+      else if (data_ni.isEmpty())
+      {
+         data_ni.setValue((data_dim.getValue() == 1)
+                           ? (ni.getValue() * nj.getValue())
+                           : ni.getValue());
+      }
+
+      if (data_dim.getValue() == 2)
+      {
+         if (!data_nj.isEmpty() && (data_nj.getValue() <= 0) )
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Dimension des donnÃ©es nÃ©gative (data_nj).") ;
+         }
+         else if (data_nj.isEmpty())
+            data_nj.setValue(nj.getValue()) ;
+      }
+
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkCompression(void)
+   {
+      if (!data_i_index.isEmpty())
+      {
+         int ssize = data_i_index.getValue()->size();
+         if (!data_n_index.isEmpty() &&
+            (data_n_index.getValue() != ssize))
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  <<"Dimension data_i_index incompatible avec data_n_index.") ;
+         }
+         else if (data_n_index.isEmpty())
+            data_n_index.setValue(ssize) ;
+
+         if (data_dim.getValue() == 2)
+         {
+            if (!data_j_index.isEmpty() &&
+               (data_j_index.getValue()->size() != data_i_index.getValue()->size()))
+            {
+               ERROR("CDomain::checkAttributes(void)",
+                     <<"Dimension data_j_index incompatible avec data_i_index.") ;
+            }
+            else if (data_j_index.isEmpty())
+            {
+               ERROR("CDomain::checkAttributes(void)",
+                     <<"La donnÃ©e data_j_index doit Ãªtre renseignÃ©e !") ;
+            }
+         }
+      }
+      else
+      {
+         if (!data_n_index.isEmpty() ||
+            ((data_dim.getValue() == 2) && (!data_j_index.isEmpty())))
+            ERROR("CDomain::checkAttributes(void)", << "data_i_index non dÃ©fini") ;
+      }
+
+      if (data_n_index.isEmpty())
+      { // -> bloc re-vÃ©rifiÃ© OK
+         if (data_dim.getValue() == 1)
+         {
+            const int dni = data_ni.getValue();
+            ARRAY_CREATE(__arri, int, 1, [dni]);
+            data_n_index.setValue(dni);
+            for (int i = 0; i < dni; i++)
+               (*__arri)[i] = i+1 ;
+            data_i_index.setValue(__arri) ;
+         }
+         else   // (data_dim == 2)
+         {
+            const int dni = data_ni.getValue() * data_nj.getValue();
+            
+            ARRAY_CREATE(__arri, int, 1, [dni]);
+            ARRAY_CREATE(__arrj, int, 1, [dni]);               
+            data_n_index.setValue(dni);
+            
+            //for(int count = 0, i = 0; i  < data_ni.getValue(); i++)
+            //for(int j = 0; j < data_nj.getValue(); j++, count++)
+            
+            for(int count = 0, j = 0; j  < data_nj.getValue(); j++)
+            {
+               for(int i = 0; i < data_ni.getValue(); i++, count++)
+               {
+                  (*__arri)[count] = i+1 ;
+                  (*__arrj)[count] = j+1 ;
+               }
+            }
+            data_i_index.setValue(__arri) ;
+            data_j_index.setValue(__arrj) ;            
+            __arri.reset();
+            __arrj.reset();
+         }
+      }
+   }
+
+   //----------------------------------------------------------------
+   
+   void CDomain::completeLonLatClient(void)
+   {
+      ARRAY_CREATE(lonvalue_temp, double, 1, [0]);
+      ARRAY_CREATE(latvalue_temp, double, 1, [0]);
+      
+      const int zoom_ibegin_client  = zoom_ibegin_loc.getValue(),
+                zoom_jbegin_client  = zoom_jbegin_loc.getValue(),
+                zoom_ni_client      = zoom_ni_loc.getValue(),
+                zoom_nj_client      = zoom_nj_loc.getValue();
+                
+      ARRAY(double, 1) lonvalue_ = this->lonvalue.getValue(),
+                       latvalue_ = this->latvalue.getValue();
+                
+      if (this->data_dim.getValue() == 2)
+      {
+         StdSize dm = zoom_ni_client * zoom_nj_client;
+
+         lonvalue_temp->resize(boost::extents[dm]);
+         latvalue_temp->resize(boost::extents[dm]);
+         
+         for (int i = 0; i < zoom_ni_client; i++)
+         {
+            for (int j = 0; j < zoom_nj_client; j++)
+            {
+               (*lonvalue_temp)[i + j * zoom_ni_client] =
+               (*lonvalue_)[(i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue()];              
+               (*latvalue_temp)[i + j * zoom_ni_client] =
+               (*latvalue_)[(i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue()];
+            }
+         }
+         this->lonvalue.setValue(lonvalue_temp);
+         this->latvalue.setValue(latvalue_temp);
+      }
+      else
+      {
+         lonvalue_temp->resize(boost::extents[zoom_ni_client]);
+         latvalue_temp->resize(boost::extents[zoom_nj_client]);
+         
+         for (int i = zoom_ibegin_client - 1; i < (zoom_ni_client - zoom_ibegin_client + 1); i++)
+         {
+            (*lonvalue_temp)[i] = (*lonvalue_)[i]; 
+         }
+         
+         for (int j = zoom_ibegin_client - 1; j < (zoom_nj_client - zoom_jbegin_client + 1); j++)
+         {
+            (*latvalue_temp)[j] = (*latvalue_)[j];
+         }
+         
+         this->lonvalue.setValue(lonvalue_temp);
+         this->latvalue.setValue(latvalue_temp);
+      }  
+   }
+ 
+   //----------------------------------------------------------------
+      
+   void CDomain::completeLonLatServer(void)
+   {
+      ARRAY_CREATE(lonvalue_temp, double, 1, [0]);
+      ARRAY_CREATE(latvalue_temp, double, 1, [0]);
+      
+      const int ibegin_serv     = ibegin.getValue(),
+                jbegin_serv     = jbegin.getValue(),
+                zoom_ni_serv    = zoom_ni_loc.getValue(),
+                zoom_nj_serv    = zoom_nj_loc.getValue(),
+                ibegin_zoom_srv = zoom_ibegin_loc.getValue(),
+                jbegin_zoom_srv = zoom_jbegin_loc.getValue();
+                      
+                       
+      if (this->data_dim.getValue() == 2)
+      {
+         StdSize dm = zoom_ni_serv * zoom_nj_serv;      
+         
+         lonvalue_temp->resize(boost::extents[dm]);
+         latvalue_temp->resize(boost::extents[dm]);
+         
+         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
+         {
+            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
+                             latvalue_loc = this->latvalue_sub[k];
+            const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
+                      zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k],
+                      ibegin_cl = ibegin_sub[k] ,
+                      jbegin_cl = jbegin_sub[k] ,
+                      ni_cl = iend_sub[k] - ibegin_sub[k] + 1;
+                      
+            for (int i = 0; i < zoom_ni_cl; i++)
+            {
+               for (int j = 0; j < zoom_nj_cl; j++)
+               {
+                  int ii = i + (ibegin_cl-1) - (ibegin_serv - 1) + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);
+                  int jj = j + (jbegin_cl-1) - (jbegin_serv - 1) + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);
+                  (*lonvalue_temp)[ii + jj * zoom_ni_serv] =
+                  (*lonvalue_loc)[i + j * zoom_ni_cl];
+                  (*latvalue_temp)[ii + jj * zoom_ni_serv] = 
+                  (*latvalue_loc)[i + j * zoom_ni_cl];
+               }
+            }
+         }
+         this->lonvalue.setValue(lonvalue_temp);
+         this->latvalue.setValue(latvalue_temp);
+      }
+      else
+      {
+         lonvalue_temp->resize(boost::extents[zoom_ni_serv]);
+         latvalue_temp->resize(boost::extents[zoom_nj_serv]);
+         
+         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
+         {
+            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
+                             latvalue_loc = this->latvalue_sub[k];
+            const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
+                      zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k];
+                      
+            for (int i = 0; i < zoom_ni_cl; i++)
+               (*lonvalue_temp)[i /*- (ibegin_serv - 1)*/ + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1)] =
+               (*lonvalue_loc)[i];
+               
+            for (int j = 0; j < zoom_nj_cl; j++)
+               (*latvalue_temp)[j /*- (jbegin_serv - 1)*/ + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1)] =
+               (*latvalue_loc)[j];
+         }       
+         this->lonvalue.setValue(lonvalue_temp);
+         this->latvalue.setValue(latvalue_temp);
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkZoom(void)
+   {
+      // RÃ©solution et vÃ©rification des donnÃ©es globales de zoom.
+      if (!this->zoom_ni.isEmpty() || !this->zoom_nj.isEmpty() ||
+          !this->zoom_ibegin.isEmpty() || !this->zoom_jbegin.isEmpty())
+      {
+         if (this->zoom_ni.isEmpty()     && this->zoom_nj.isEmpty() &&
+             this->zoom_ibegin.isEmpty() && this->zoom_jbegin.isEmpty())
+         {
+            ERROR("CDomain::checkZoom(void)",
+                  <<"Les attributs dÃ©finissant un zoom doivent tous Ãªtre dÃ©finis") ;
+         }
+         else
+         {
+            int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
+            int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+                
+            if (zoom_ibegin.getValue() < 1  || zoom_jbegin.getValue() < 1 ||
+                zoom_iend > ni_glo.getValue() || zoom_jend > nj_glo.getValue())
+               ERROR("CDomain::checkZoom(void)",
+                     << "Zoom mal dÃ©fini,"
+                     << " vÃ©rifiez les valeurs zoom_ni, zoom_nj, zoom_ibegin, zoom_ibegin") ;
+         }
+      }
+      else
+      {
+         this->zoom_ni.setValue(this->ni_glo.getValue()); 
+         this->zoom_nj.setValue(this->nj_glo.getValue());
+         this->zoom_ibegin.setValue(1);
+         this->zoom_jbegin.setValue(1);
+      }
+      // RÃ©solution des donnÃ©es locales de zoom.
+      {
+         int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
+         int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+         
+         if ((zoom_ibegin.getValue() > iend.getValue()) || 
+             (zoom_iend < ibegin.getValue()))
+         {
+            zoom_ni_loc.setValue(0);
+            zoom_ibegin_loc.setValue(zoom_ibegin.getValue());
+         }
+         else
+         {
+            int zoom_ibegin_loc_ = (zoom_ibegin.getValue() > ibegin.getValue()) 
+                                 ? zoom_ibegin.getValue()
+                                 : ibegin.getValue();
+            int zoom_iend_loc_  = (zoom_iend < iend.getValue()) 
+                                 ? zoom_iend
+                                 : iend.getValue();
+            int zoom_ni_loc_ = zoom_iend_loc_ - zoom_ibegin_loc_ + 1;
+            
+            zoom_ni_loc.setValue(zoom_ni_loc_);
+            zoom_ibegin_loc.setValue(zoom_ibegin_loc_-ibegin.getValue()+1);
+         }
+         
+         if ((zoom_jbegin.getValue() > jend.getValue()) || 
+             (zoom_jend < jbegin.getValue()))
+         {
+            zoom_nj_loc.setValue(0);
+            zoom_jbegin_loc.setValue(zoom_jbegin.getValue());
+         }
+         else
+         {
+            int zoom_jbegin_loc_ = (zoom_jbegin.getValue() > jbegin.getValue()) 
+                                 ? zoom_jbegin.getValue()
+                                 : jbegin.getValue();
+            int zoom_jend_loc_  = (zoom_jend < jend.getValue()) 
+                                 ? zoom_jend
+                                 : jend.getValue();
+            int zoom_nj_loc_ = zoom_jend_loc_ - zoom_jbegin_loc_ + 1;
+            
+            zoom_nj_loc.setValue(zoom_nj_loc_);
+            zoom_jbegin_loc.setValue(zoom_jbegin_loc_-jbegin.getValue()+1);
+         }
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void CDomain::checkAttributes(void)
+   {
+      if (this->isChecked) return;
+      shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+
+      this->checkGlobalDomain();
+      this->checkLocalIDomain();
+      this->checkLocalJDomain();
+      
+      this->checkZoom();
+      
+      if (context->hasClient)
+      { // CÃŽtÃ© client uniquement
+         this->checkMask();
+         this->checkDomainData();
+         this->checkCompression();
+         
+         this->ibegin_sub.push_back(this->ibegin.getValue());
+         this->jbegin_sub.push_back(this->jbegin.getValue());
+         this->iend_sub.push_back(this->iend.getValue());
+         this->jend_sub.push_back(this->jend.getValue()); 
+
+         this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue());
+         this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue());
+         this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue());
+         this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
+      
+         this->latvalue_sub.push_back(this->latvalue.getValue());
+         this->lonvalue_sub.push_back(this->lonvalue.getValue());  
+
+
+//         if (!this->isEmpty())
+//         {
+            this->completeLonLatClient();
+//         }
+         this->completeMask();
+
+      }
+      else
+      { // CÃŽtÃ© serveur uniquement
+//         if (!this->isEmpty())
+// ne sert plus //   this->completeLonLatServer();
+      }
+    
+      if (context->hasClient)
+      {
+        computeConnectedServer() ;
+        sendServerAttribut() ;
+        sendLonLat() ;
+      }
+      
+      this->isChecked = true;
+   }
+   
+  void CDomain::sendServerAttribut(void)
+  {
+    int ni_srv=ni_glo.getValue() ;
+    int ibegin_srv=1 ;
+    int iend_srv=ni_glo.getValue() ;
+     
+    int nj_srv ;
+    int jbegin_srv ;
+    int jend_srv ;
+    
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    CContextClient* client=context->client ;
+    int nbServer=client->serverSize ;
+    int serverRank=client->getServerLeader() ;
+    
+    jend_srv=0 ;
+    for(int i=0;i<=serverRank;i++)
+    {
+      jbegin_srv=jend_srv+1 ;
+      nj_srv=nj_glo.getValue()/nbServer ;
+      if (i<nj_glo.getValue()%nbServer) nj_srv++ ;
+      jend_srv=jbegin_srv+nj_srv-1 ;
+    }
+    
+     CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT) ;   
+     if (client->isServerLeader())
+     {
+       CMessage msg ;
+       msg<<this->getId() ;
+       msg<<ni_srv<<ibegin_srv<<iend_srv<<nj_srv<<jbegin_srv<<jend_srv;
+       event.push(client->getServerLeader(),1,msg) ;
+       client->sendEvent(event) ;
+     }
+     else client->sendEvent(event) ;
+  }
+  
+  void CDomain::computeConnectedServer(void)
+  {
+    int ib,ie,in;
+    int jb,je,jn ;
+    
+    int ni_srv=ni_glo.getValue() ;
+    int ibegin_srv=1 ;
+    int iend_srv=ni_glo.getValue() ;
+     
+    int nj_serv,jbegin_srv, jend_srv ;
+    int zoom_ibegin_srv,zoom_iend_srv,zoom_ni_srv ;
+    int zoom_jbegin_srv,zoom_jend_srv,zoom_nj_srv ;
+    
+    ibegin_client=ibegin.getValue() ; iend_client=iend.getValue() ; ni_client=ni.getValue() ;
+    jbegin_client=jbegin.getValue() ; jend_client=jend.getValue() ; nj_client=nj.getValue() ;
+     
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    CContextClient* client=context->client ;
+    int nbServer=client->serverSize ;
+    
+    // compute client zoom indices
+    int zoom_iend=zoom_ibegin.getValue()+zoom_ni.getValue()-1 ;
+    zoom_ibegin_client = ibegin_client > zoom_ibegin.getValue() ? ibegin_client : zoom_ibegin.getValue() ;
+    zoom_iend_client = iend_client < zoom_iend ? iend_client : zoom_iend ;
+    zoom_ni_client=zoom_iend_client-zoom_ibegin_client+1 ;
+    if (zoom_ni_client<0) zoom_ni_client=0 ;
+
+    int zoom_jend=zoom_jbegin.getValue()+zoom_nj.getValue()-1 ;
+    zoom_jbegin_client = jbegin_client > zoom_jbegin.getValue() ? jbegin_client : zoom_jbegin.getValue() ;
+    zoom_jend_client = jend_client < zoom_jend ? jend_client : zoom_jend ;
+    zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;
+    if (zoom_nj_client<0) zoom_nj_client=0 ;
+ 
+    // find how much client are connected to a server
+    jend_srv=0 ;
+    for(int ns=0;ns<nbServer;ns++)
+    {
+      jbegin_srv=jend_srv+1 ;
+      nj_srv=nj_glo.getValue()/nbServer ;
+      if (ns<nj_glo.getValue()%nbServer) nj_srv++ ;
+      jend_srv=jbegin_srv+nj_srv-1 ;
+      
+      ib = ibegin_client>ibegin_srv ? ibegin_client : ibegin_srv ;
+      ie=  iend_client< iend_srv? iend_client : iend_srv ;
+      in=ie-ib+1 ;
+      if (in<0) in=0 ;
+      
+      jb= jbegin_client>jbegin_srv ? jbegin_client : jbegin_srv ;
+      je= jend_client<jend_srv ? jend_client : jend_srv ;
+      jn=je-jb+1 ;
+      if (jn<0) jn=0 ;
+        
+      if (in>0 && jn>0)
+      {
+        zoom_ibegin_srv = zoom_ibegin.getValue() > ibegin_srv ? zoom_ibegin.getValue() : ibegin_srv ;
+        zoom_iend_srv = zoom_iend < iend_srv ? zoom_iend : iend_srv ;
+        zoom_ni_srv=zoom_iend_srv-zoom_ibegin_srv+1 ;
+        if (zoom_ni_srv<0) zoom_ni_srv=0 ;
+      
+        zoom_jbegin_srv = zoom_jbegin.getValue() > jbegin_srv ? zoom_jbegin.getValue() : 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_nj_srv<0) zoom_nj_srv=0 ;
+ 
+        if (zoom_ni_srv>0 && zoom_nj_srv>0 && zoom_ni_client>0 && zoom_nj_client>0)
+        {
+          ib = zoom_ibegin_client>zoom_ibegin_srv ? zoom_ibegin_client : zoom_ibegin_srv ;
+          ie=zoom_iend_client<zoom_iend_srv?zoom_iend_client:zoom_iend_srv ;
+          in=ie-ib+1 ;
+          if (in<0) in=0 ;
+        
+          jb=zoom_jbegin_client>zoom_jbegin_srv?zoom_jbegin_client:zoom_jbegin_srv ;
+          je=zoom_jend_client<zoom_jend_srv?zoom_jend_client:zoom_jend_srv ;
+          jn=je-jb+1 ;
+          if (jn<0) jn=0 ;
+        }
+        else
+        {
+          ib=1 ; ie=0 ; in=0 ;
+          jb=1 ; je=0 ; jn=0 ;
+        }
+        
+//          if (in>0 && jn>0) 
+//          { 
+            connectedServer.push_back(ns) ;
+            ib_srv.push_back(ib) ;
+            ie_srv.push_back(ie) ;
+            in_srv.push_back(in) ;
+            jb_srv.push_back(jb) ;
+            je_srv.push_back(je) ;
+            jn_srv.push_back(jn) ;
+//           }
+        
+      }
+    }
+    int nbConnectedServer=connectedServer.size() ;
+    int* recvCount=new int[client->clientSize] ;
+    int* displ=new int[client->clientSize] ;
+    int* sendBuff=new int[nbConnectedServer] ;
+    valarray<int> nbClient(0,client->serverSize) ;
+    
+    for(int n=0;n<nbConnectedServer;n++) sendBuff[n]=connectedServer[n] ;
+    
+    // get connected server for everybody
+    MPI_Allgather(&nbConnectedServer,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm) ;
+    
+    displ[0]=0 ;
+    for(int n=1;n<client->clientSize;n++) displ[n]=displ[n-1]+recvCount[n-1] ;
+    int recvSize=displ[client->clientSize-1]+recvCount[client->clientSize-1] ;
+    int* recvBuff=new int[recvSize] ;
+ 
+    
+    MPI_Allgatherv(sendBuff,nbConnectedServer,MPI_INT,recvBuff,recvCount,displ,MPI_INT,client->intraComm) ;
+    for(int n=0;n<recvSize;n++) nbClient[recvBuff[n]]++ ;
+    
+    for(int n=0;n<nbConnectedServer;n++) nbSenders.push_back(nbClient[connectedServer[n]]) ;
+   
+    delete [] recvCount ;
+    delete [] displ ;
+    delete [] sendBuff ;
+    delete [] recvBuff ;
+  }
+  
+  void CDomain::sendLonLat(void)
+  {
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    CContextClient* client=context->client ;
+    // send lon lat for each connected server
+    CEventClient event(getType(),EVENT_ID_LON_LAT) ;
+    
+    ARRAY(double, 1) lonvalue_client = lonvalue.getValue(),
+                     latvalue_client = latvalue.getValue();
+    
+    int ib,ie,in ;
+    int jb,je,jn ;
+  
+    list<shared_ptr<CMessage> > list_msg ;    
+    list<ARRAY(double,1)> list_indi,list_indj,list_lon,list_lat ;
+
+    for(int ns=0;ns<connectedServer.size();ns++)
+    {
+      ib=ib_srv[ns] ; ie=ie_srv[ns] ; in=in_srv[ns] ;
+      jb=jb_srv[ns] ; je=je_srv[ns] ; jn=jn_srv[ns] ;
+      
+      ARRAY_CREATE(indi,double,1,[in*jn]) ;
+      ARRAY_CREATE(indj,double,1,[in*jn]) ;
+      ARRAY_CREATE(lon,double,1,[in*jn]) ;
+      ARRAY_CREATE(lat,double,1,[in*jn]) ;
+
+          
+      int ind_client,ind_loc ;
+      
+      for(int j=jb;j<=je;j++)
+        for(int i=ib;i<=ie;i++)
+        {
+          ind_client=(i-zoom_ibegin_client)+(j-zoom_jbegin_client)*zoom_ni_client ;
+          ind_loc=(i-ib)+(j-jb)*in ;
+          (*lon)[ind_loc]=(*lonvalue_client)[ind_client] ;
+          (*lat)[ind_loc]=(*latvalue_client)[ind_client] ;
+          (*indi)[ind_loc]=i ;
+          (*indj)[ind_loc]=j ;
+        }
+      
+      list_indi.push_back(indi) ; list_indj.push_back(indj) ;
+      list_lon.push_back(lon) ; list_lat.push_back(lat) ;
+      list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
+
+      *list_msg.back()<<this->getId() ;
+      *list_msg.back()<<list_indi.back()<<list_indj.back()<<list_lon.back()<<list_lat.back() ;
+      event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ;
+    }
+
+    client->sendEvent(event) ;
+  }
+  
+  bool CDomain::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_LON_LAT :
+             recvLonLat(event) ;
+             return true ;
+             break ;
+           default :
+             ERROR("bool CContext::dispatchEvent(CEventServer& event)",
+                    <<"Unknown Event") ;
+           return false ;
+         }
+      }
+   }
+   
+  void CDomain::recvServerAttribut(CEventServer& event)
+  {
+    CBufferIn* buffer=event.subEvents.begin()->buffer;
+    string domainId ;
+    *buffer>>domainId ;
+    get(domainId)->recvServerAttribut(*buffer) ;
+  }
+  
+  void CDomain::recvServerAttribut(CBufferIn& buffer)
+  {
+    int zoom_iend=zoom_ibegin.getValue()+zoom_ni.getValue()-1 ;
+    int zoom_jend=zoom_jbegin.getValue()+zoom_nj.getValue()-1 ;
+
+     buffer>>ni_srv>>ibegin_srv>>iend_srv>>nj_srv>>jbegin_srv>>jend_srv;
+    
+    zoom_ibegin_srv = zoom_ibegin.getValue() > ibegin_srv ? zoom_ibegin.getValue() : 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 = zoom_jbegin.getValue() > jbegin_srv ? zoom_jbegin.getValue() : 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) 
+    {
+      zoom_ibegin_srv=1 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ;
+      zoom_jbegin_srv=1 ; zoom_jend_srv=0 ; zoom_nj_srv=0 ;
+    }
+    
+    lonvalue_srv->resize(extents[zoom_ni_srv*zoom_nj_srv]) ;
+    latvalue_srv->resize(extents[zoom_ni_srv*zoom_nj_srv]) ;
+  }
+    
+  void CDomain::recvLonLat(CEventServer& event)
+  {
+    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)->recvLonLat(*buffer) ;
+    }
+  }
+  
+  void CDomain::recvLonLat(CBufferIn& buffer)
+  {
+    ARRAY_CREATE(indi,double,1,[0]) ;
+    ARRAY_CREATE(indj,double,1,[0]) ;
+    ARRAY_CREATE(lon,double,1,[0]) ;
+    ARRAY_CREATE(lat,double,1,[0]) ;
+    
+    buffer>>indi>>indj>>lon>>lat ;
+    int i,j,ind_srv ;
+
+    for(int ind=0;ind<indi->num_elements();ind++)
+    {
+      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] ;
+      (*latvalue_srv)[ind_srv]=(*lat)[ind] ;
+    }
+  }
+   //----------------------------------------------------------------
+   
+   void CDomain::completeMask(void)
+   {
+      this->local_mask->resize(boost::extents[zoom_ni_loc.getValue()][zoom_nj_loc.getValue()]);
+   }
+
+   //----------------------------------------------------------------
+
+   ARRAY(int, 2) CDomain::getLocalMask(void) const
+   {
+      return (this->local_mask);
+   }
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<int> & CDomain::getIBeginSub(void) const
+   {
+      return (this->ibegin_sub);
+   }
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<int> & CDomain::getIBeginZoomSub(void) const
+   {
+      return (this->ibegin_zoom_sub);
+   }
+
+   const std::vector<int> & CDomain::getNiZoomSub(void) const
+   {
+      return (this->ni_zoom_sub);
+   }
+               
+   //----------------------------------------------------------------
+                     
+   const std::vector<int> & CDomain::getIEndSub(void) const
+   {
+      return (this->iend_sub);
+   }
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<int> & CDomain::getJBeginSub(void) const
+   {
+      return (this->jbegin_sub);
+   }
+   
+   //----------------------------------------------------------------
+      
+   const std::vector<int> & CDomain::getJBeginZoomSub(void) const
+   {
+      return (this->jbegin_zoom_sub);
+   }
+
+   const std::vector<int> & CDomain::getNjZoomSub(void) const
+   {
+      return (this->nj_zoom_sub);
+   }
+                  
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<int> & CDomain::getJEndSub(void) const
+   {
+      return (this->jend_sub);
+   }
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<ARRAY(double, 1)> & CDomain::getLonValueSub(void) const
+   {
+      return (this->lonvalue_sub);
+   }
+   
+   //----------------------------------------------------------------
+   
+   const std::vector<ARRAY(double, 1)> & CDomain::getLatValueSub(void) const
+   {
+      return (this->latvalue_sub);
+   }   
+   
+   ///---------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/domain.hpp
===================================================================
--- /XIOS/trunk/src/node/domain.hpp	(revision 306)
+++ /XIOS/trunk/src/node/domain.hpp	(revision 306)
@@ -0,0 +1,169 @@
+#ifndef __XMLIO_CDomain__
+#define __XMLIO_CDomain__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "declare_group.hpp"
+#include "event_client.hpp"
+#include "event_server.hpp"
+#include "buffer_in.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CDomainGroup;
+   class CDomainAttributes;
+   class CDomain;
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CDomainAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain)
+#  include "domain_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CDomain)
+
+   ///--------------------------------------------------------------
+
+   class CDomain
+      : public CObjectTemplate<CDomain>
+      , public CDomainAttributes
+   {
+         enum EEventId
+         {
+           EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LON_LAT
+         } ;
+         
+         /// typedef ///
+         typedef CObjectTemplate<CDomain>   SuperClass;
+         typedef CDomainAttributes SuperClassAttribute;
+
+      public :
+
+         typedef CDomainAttributes RelAttributes;
+         typedef CDomainGroup      RelGroup;
+
+         /// Constructeurs ///
+         CDomain(void);
+         explicit CDomain(const StdString & id);
+         CDomain(const CDomain & domain);       // Not implemented yet.
+         CDomain(const CDomain * const domain); // Not implemented yet.
+
+         /// VÃ©rifications ///
+         void checkAttributes(void);
+
+      private :
+
+         void checkGlobalDomain(void);
+
+         void checkLocalIDomain(void);
+         void checkLocalJDomain(void);
+
+         void checkMask(void);
+         void checkDomainData(void);
+         void checkCompression(void);
+         
+         void checkZoom(void);
+
+         void completeMask(void);
+
+      public :
+      
+         /// Autres ///
+         virtual void fromBinary(StdIStream & is);
+
+         /// Accesseurs ///
+         ARRAY(int, 2) getLocalMask(void) const;
+         
+         const std::set<StdString> & getRelFiles(void) const;
+
+         const std::vector<int> & getIBeginSub(void) const;
+         const std::vector<int> & getIEndSub(void) const;
+         const std::vector<int> & getJBeginSub(void) const;
+         const std::vector<int> & getJEndSub(void) const;
+
+         const std::vector<int> & getIBeginZoomSub(void) const;
+         const std::vector<int> & getJBeginZoomSub(void) const;
+         const std::vector<int> & getNiZoomSub(void) const;
+         const std::vector<int> & getNjZoomSub(void) const;
+         
+         const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const;
+         const std::vector<ARRAY(double, 1)> & getLatValueSub(void) const;
+
+         /// Test ///
+         bool IsWritten(const StdString & filename) const;
+         bool hasZoom(void) const;
+         bool isEmpty(void) const;
+         
+         
+         int ni_client,ibegin_client,iend_client ;
+         int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;
+
+         int nj_client,jbegin_client,jend_client ;
+         int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ;
+
+         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 ;
+
+         ARRAY(double, 1) lonvalue_srv, latvalue_srv ;
+         
+         
+        vector<int> connectedServer,nbSenders ;
+        vector<int> ib_srv, ie_srv, in_srv ;
+        vector<int> jb_srv, je_srv, jn_srv ;
+         
+      public :
+      
+         /// Mutateur ///
+         void addRelFile(const StdString & filename);
+         void completeLonLatServer(void);
+         void completeLonLatClient(void);
+         void sendServerAttribut(void) ;
+         void sendLonLat(void) ;
+         void computeConnectedServer(void) ;
+         static bool dispatchEvent(CEventServer& event) ;
+         static void recvLonLat(CEventServer& event) ;
+         static void recvServerAttribut(CEventServer& event) ;
+         void recvLonLat(CBufferIn& buffer) ;
+         void recvServerAttribut(CBufferIn& buffer) ;
+         
+         /// Destructeur ///
+         virtual ~CDomain(void);
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);
+         
+         static ENodeType GetType(void);
+
+       private :
+
+         /// ProriÃ©tÃ©s protÃ©gÃ©es ///
+         bool isChecked;
+         ARRAY(int, 2) local_mask;
+         std::set<StdString> relFiles;
+
+         std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub;
+         std::vector<int> ibegin_zoom_sub, jbegin_zoom_sub, ni_zoom_sub, nj_zoom_sub;
+         std::vector<ARRAY(double, 1)> lonvalue_sub, latvalue_sub;
+         
+
+   }; // class CDomain
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CDomainGroup and CDomainDefinition
+   DECLARE_GROUP(CDomain);
+
+   ///--------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDomain__
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 306)
+++ /XIOS/trunk/src/node/field.cpp	(revision 306)
@@ -0,0 +1,547 @@
+#include "field.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "node_type.hpp"
+#include "calendar_util.hpp"
+#include "xios_manager.hpp"
+
+namespace xmlioserver{
+namespace tree {
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CField::CField(void)
+      : CObjectTemplate<CField>(), CFieldAttributes()
+      , refObject(), baseRefObject()
+      , grid(), file()
+      , freq_operation(), freq_write()
+      , nstep(0)
+      , last_Write(), last_operation()
+      , foperation()
+      , data(new CArray<double, 1>(boost::extents[0]))
+   { /* Ne rien faire de plus */ }
+
+   CField::CField(const StdString & id)
+      : CObjectTemplate<CField>(id), CFieldAttributes()
+      , refObject(), baseRefObject()
+      , grid(), file()
+      , freq_operation(), freq_write()
+      , nstep(0)
+      , last_Write(), last_operation()
+      , foperation()
+      , data(new CArray<double, 1>(boost::extents[0]))
+   { /* Ne rien faire de plus */ }
+
+   CField::~CField(void)
+   {
+      this->grid.reset() ;
+      this->file.reset() ;
+      this->foperation.reset() ;
+      this->data.reset() ;
+   }
+
+   //----------------------------------------------------------------
+
+   bool CField::updateDataServer
+      (const date::CDate & currDate,
+       const std::deque<ARRAY(double, 1)> storedClient)
+   {
+      const date::CDate opeDate      = *last_operation + freq_operation;
+      const date::CDate writeDate    = *last_Write     + freq_write; 
+      
+      if (opeDate <= currDate)
+      {
+         if (this->data->num_elements() != this->grid->storeIndex[0]->num_elements())
+         {
+            this->data->resize(boost::extents[this->grid->storeIndex[0] ->num_elements()]);
+         }  
+         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
+         this->grid->inputFieldServer(storedClient, input);          
+         (*this->foperation)(input);
+         *last_operation = currDate;
+      }
+      if (writeDate < (currDate + freq_operation))
+      {
+         this->foperation->final();
+         this->incrementNStep();
+         *last_Write = writeDate;
+         return (true);        
+      }
+      return (false);
+   }
+   
+   bool CField::dispatchEvent(CEventServer& event)
+  {
+     
+    if (SuperClass::dispatchEvent(event)) return true ;
+    else
+    {
+      switch(event.type)
+      {
+        case EVENT_ID_UPDATE_DATA :
+          recvUpdateData(event) ;
+          return true ;
+          break ;
+ 
+        default :
+          ERROR("bool CField::dispatchEvent(CEventServer& event)",<<"Unknown Event") ;
+          return false ;
+      }
+    }
+  }
+  
+  void CField::sendUpdateData(void)
+  {
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    CContextClient* client=context->client ;
+    
+    CEventClient event(getType(),EVENT_ID_UPDATE_DATA) ;
+    
+    map<int,ARRAY(int, 1)>::iterator it ;
+    list<shared_ptr<CMessage> > list_msg ;
+    list<ARRAY(double,1) > list_data ;
+    
+    for(it=grid->storeIndex_toSrv.begin();it!=grid->storeIndex_toSrv.end();it++)
+    {
+      int rank=(*it).first ;
+      ARRAY(int,1) index=(*it).second ;
+      ARRAY_CREATE(data_tmp,double,1,[index->num_elements()]) ;
+      for(int n=0;n<data_tmp->num_elements();n++) (*data_tmp)[n]=(*data)[(*index)[n]] ;
+      list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
+      list_data.push_back(data_tmp) ;
+      *list_msg.back()<<getId()<<list_data.back() ;
+      event.push(rank,grid->nbSenders[rank],*list_msg.back()) ;
+    }
+    client->sendEvent(event) ;
+  }
+  
+  void CField::recvUpdateData(CEventServer& event)
+  {
+    vector<int> ranks ;
+    vector<CBufferIn*> buffers ;
+      
+    list<CEventServer::SSubEvent>::iterator it ;
+    string fieldId ;
+
+    for (it=event.subEvents.begin();it!=event.subEvents.end();++it)
+    {
+      int rank=it->rank;
+      CBufferIn* buffer=it->buffer;
+      *buffer>>fieldId ;
+      ranks.push_back(rank) ;
+      buffers.push_back(buffer) ;
+    }
+    get(fieldId)->recvUpdateData(ranks,buffers) ;   
+  }
+  
+  void  CField::recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers)
+  {
+    
+    if (data_srv.empty())
+    {
+      for(map<int,ARRAY(int, 1)>::iterator it=grid->out_i_fromClient.begin();it!=grid->out_i_fromClient.end();it++)
+      {
+        int rank=it->first ;
+        ARRAY_CREATE(data_tmp,double,1,[it->second->num_elements()]) ;
+        data_srv.insert(pair<int, ARRAY(double,1)>(rank,data_tmp)) ;
+        foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(data_srv[rank])))) ;
+      }
+    }
+
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    const date::CDate & currDate = context->getCalendar()->getCurrentDate();
+    const date::CDate opeDate      = *last_operation_srv + freq_operation_srv;
+    const date::CDate writeDate    = *last_Write_srv     + freq_write_srv; 
+    
+
+    
+    if (opeDate <= currDate)
+    {
+      for(int n=0;n<ranks.size();n++)
+      {
+        ARRAY_CREATE(data_tmp,double,1,[0]) ;
+        *buffers[n]>>data_tmp ;
+        (*foperation_srv[ranks[n]])(data_tmp) ;
+      }
+      *last_operation_srv = currDate;
+    }
+     
+    if (writeDate < (currDate + freq_operation_srv))
+    {
+      for(int n=0;n<ranks.size();n++)
+      {
+        this->foperation_srv[ranks[n]]->final();
+      }
+      
+      this->incrementNStep();
+      *last_Write_srv = writeDate;
+      writeField() ;
+    }
+  }
+  
+  void CField::writeField(void)
+  {
+    if (! grid->domain->isEmpty() || getRelFile()->type.getValue()=="one_file") 
+      getRelFile()->getDataOutput()->writeFieldData(CObjectFactory::GetObject<CField>(this));
+  }
+   //----------------------------------------------------------------
+
+   void CField::setRelFile(const boost::shared_ptr<CFile> _file)
+   { 
+      this->file = _file; 
+   }
+
+   //----------------------------------------------------------------
+
+   StdString CField::GetName(void)   { return (StdString("field")); }
+   StdString CField::GetDefName(void){ return (CField::GetName()); }
+   ENodeType CField::GetType(void)   { return (eField); }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<CGrid> CField::getRelGrid(void) const
+   { 
+      return (this->grid); 
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<CFile> CField::getRelFile(void) const
+   { 
+      return (this->file);
+   }
+   
+   StdSize CField::getNStep(void) const
+   {
+      return (this->nstep);
+   }
+   
+   void CField::incrementNStep(void)
+   {
+      this->nstep++;
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<CField> CField::getDirectFieldReference(void) const
+   {
+      if (this->field_ref.isEmpty())
+         return (this->getBaseFieldReference());
+
+      if (! CObjectFactory::HasObject<CField>(this->field_ref.getValue()))
+         ERROR("CField::getDirectFieldReference(void)",
+               << "[ ref_name = " << this->field_ref.getValue() << "]"
+               << " invalid field name !");
+
+      return (CObjectFactory::GetObject<CField>(this->field_ref.getValue()));
+   }
+
+   //----------------------------------------------------------------
+
+   const boost::shared_ptr<CField> CField::getBaseFieldReference(void) const
+   { 
+      return (baseRefObject); 
+   }
+
+   //----------------------------------------------------------------
+
+   const std::vector<boost::shared_ptr<CField> > & CField::getAllReference(void) const 
+   { 
+      return (refObject);
+   }
+
+   //----------------------------------------------------------------
+
+   const StdString & CField::getBaseFieldId(void) const
+   { 
+      return (this->getBaseFieldReference()->getId());
+   }
+   
+   //----------------------------------------------------------------
+   
+   const date::CDuration & CField::getFreqOperation(void) const
+   {
+      return (this->freq_operation);
+   }
+   
+   //----------------------------------------------------------------
+   const date::CDuration & CField::getFreqWrite(void) const
+   {
+      return (this->freq_write);
+   }
+   
+   //----------------------------------------------------------------
+         
+   boost::shared_ptr<func::CFunctor> CField::getFieldOperation(void) const
+   {
+      return (this->foperation);
+   }
+
+   //----------------------------------------------------------------
+
+   bool CField::hasDirectFieldReference(void) const
+   { 
+      return (!this->field_ref.isEmpty()); 
+   }
+   
+   //----------------------------------------------------------------
+   
+   ARRAY(double, 1) CField::getData(void) const
+   {
+      return(this->data);
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<date::CDate> CField::getLastWriteDate(void) const
+   {
+      return(this->last_Write);
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<date::CDate> CField::getLastOperationDate(void) const
+   {
+      return(this->last_operation);
+   }
+
+   //----------------------------------------------------------------
+
+   void CField::solveRefInheritance(void)
+   {
+      std::set<CField *> sset;
+      boost::shared_ptr<CField> refer_sptr;
+      CField * refer_ptr = this;
+      
+      this->baseRefObject = CObjectFactory::GetObject<CField>(this);
+      
+      while (refer_ptr->hasDirectFieldReference())
+      {
+         refer_sptr = refer_ptr->getDirectFieldReference();
+         refer_ptr  = refer_sptr.get();
+
+         if(sset.end() != sset.find(refer_ptr))
+         {
+            DEBUG (<< "DÃ©pendance circulaire stoppÃ©e pour l'objet de type CField sur "
+                   << "\"" + refer_ptr->getId() + "\" !");
+            break;
+         }
+
+         SuperClassAttribute::setAttributes(refer_ptr);
+         sset.insert(refer_ptr);
+         baseRefObject = refer_sptr;
+//ym         refObject.push_back(refer_sptr);
+      }
+   }
+
+   //----------------------------------------------------------------
+
+   void  CField::solveOperation(void)
+   {
+      using namespace func;
+      using namespace date;
+       
+      StdString id = this->getBaseFieldReference()->getId();
+      boost::shared_ptr<CContext> context =
+         CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+
+      if (operation.isEmpty() || freq_op.isEmpty() || this->file->output_freq.isEmpty())
+      {
+         ERROR("CField::solveOperation(void)",
+               << "[ id = " << id << "]"
+               << "Impossible de dÃ©finir une opÃ©ration pour le champ !");
+      }
+      
+      CDuration freq_offset_ = NoneDu;
+      if (!freq_offset.isEmpty())
+      {
+         freq_offset_ = CDuration::FromString(freq_offset.getValue());
+      }
+      else
+      {
+         freq_offset.setValue(NoneDu.toString());
+      }  
+
+//      if (CXIOSManager::GetStatus() == CXIOSManager::LOC_SERVER)
+      if (context->hasServer)
+      {
+         this->freq_operation_srv =
+             CDuration::FromString(this->file->output_freq.getValue());
+         this->freq_write_srv     =
+             CDuration::FromString(this->file->output_freq.getValue());
+         this->last_Write_srv     = boost::shared_ptr<xmlioserver::date::CDate>
+                        (new date::CDate(context->getCalendar()->getInitDate()));
+         this->last_operation_srv = boost::shared_ptr<xmlioserver::date::CDate>
+                        (new date::CDate(context->getCalendar()->getInitDate()));
+//         this->foperation_srv     =
+//             boost::shared_ptr<func::CFunctor>(new CInstant(this->data_srv));
+             
+         const CDuration toffset = this->freq_operation_srv - freq_offset_ - context->getCalendar()->getTimeStep(); 
+         *this->last_operation_srv   = *this->last_operation_srv - toffset; 
+      }
+      
+      if (context->hasClient)
+      {                  
+         this->freq_operation = CDuration::FromString(freq_op.getValue());
+         this->freq_write     = CDuration::FromString(this->file->output_freq.getValue());
+         this->last_Write     = boost::shared_ptr<xmlioserver::date::CDate>
+                        (new date::CDate(context->getCalendar()->getInitDate()));
+         this->last_operation = boost::shared_ptr<xmlioserver::date::CDate>
+                        (new date::CDate(context->getCalendar()->getInitDate()));
+                        
+         const CDuration toffset = this->freq_operation - freq_offset_ - context->getCalendar()->getTimeStep(); 
+         *this->last_operation   = *this->last_operation - toffset;  
+         
+#define DECLARE_FUNCTOR(MType, mtype)              \
+   if  (operation.getValue().compare(#mtype) == 0) \
+   {                                               \
+      boost::shared_ptr<func::CFunctor>            \
+            foperation_(new C##MType(this->data)); \
+      this->foperation = foperation_;              \
+      return;                                      \
+   }
+   
+#include "functor_type.conf"
+         
+         ERROR("CField::solveOperation(void)",
+               << "[ operation = " << operation.getValue() << "]"
+               << "L'opÃ©ration n'est pas dÃ©finie dans le code !");
+      }
+   }
+   
+   //----------------------------------------------------------------
+   
+   void CField::fromBinary(StdIStream & is)
+   {
+      SuperClass::fromBinary(is);
+#define CLEAR_ATT(name_)\
+      SuperClassAttribute::operator[](#name_)->clear()
+
+         CLEAR_ATT(domain_ref);
+         CLEAR_ATT(axis_ref);
+#undef CLEAR_ATT
+
+   }
+
+   //----------------------------------------------------------------
+
+   void CField::solveGridReference(void)
+   {
+      boost::shared_ptr<CDomain> domain;
+      boost::shared_ptr<CAxis> axis;
+
+      if (!domain_ref.isEmpty())
+      {
+         if (CObjectFactory::HasObject<CDomain>(domain_ref.getValue()))
+            domain = CObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;
+         else
+            ERROR("CField::solveGridReference(void)",
+                  << "RÃ©fÃ©rence au domaine nommÃ© \'"
+                  << domain_ref.getValue() << "\' incorrecte") ;
+      }
+
+      if (!axis_ref.isEmpty())
+      {
+         if (CObjectFactory::HasObject<CAxis>(axis_ref.getValue()))
+            axis = CObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;
+         else
+            ERROR("CField::solveGridReference(void)",
+                  << "RÃ©fÃ©rence Ã  l'axe nommÃ© \'"
+                  << axis_ref.getValue() <<"\' incorrecte") ;
+      }
+
+      if (!grid_ref.isEmpty())
+      {
+         if (CObjectFactory::HasObject<CGrid>(grid_ref.getValue()))
+            this->grid = CObjectFactory::GetObject<CGrid>(grid_ref.getValue()) ;
+         else
+            ERROR("CField::solveGridReference(void)",
+                  << "RÃ©fÃ©rence Ã  la grille nommÃ©e \'"
+                  << grid_ref.getValue() << "\' incorrecte");
+         if (!domain_ref.isEmpty())
+            DEBUG(<< "DÃ©finition conjointe de la grille "
+                  << "et du domaine, la grille prÃ©vaut..." );
+         if (!axis_ref.isEmpty())
+            DEBUG(<< "DÃ©finition conjointe de la grille "
+                  << "et de l'axe vertical, la grille prÃ©vaut...") ;
+      }
+      else
+      {
+         if (!domain_ref.isEmpty())
+         {
+            if (!axis_ref.isEmpty())
+            {
+               this->grid = CGrid::CreateGrid(domain, axis) ;
+               this->grid_ref.setValue(this->grid->getId());
+            }
+            else
+            {
+               this->grid = CGrid::CreateGrid(domain) ;
+               this->grid_ref.setValue(this->grid->getId());
+            }
+         }
+         else
+         {
+            ERROR("CField::solveGridReference(void)",
+                  << "Le domaine horizontal pour le champ X n'est pas dÃ©fini");
+         }
+      }
+      grid->solveReference() ;
+   }
+
+   } // namespace tree
+
+   ///-------------------------------------------------------------------
+
+   template <>
+      void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)
+   {
+      if (this->group_ref.isEmpty()) return;
+      StdString gref = this->group_ref.getValue();
+
+      if (!CObjectFactory::HasObject<CFieldGroup>(gref))
+         ERROR("CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)",
+               << "[ gref = " << gref << "]"
+               << " invalid group name !");
+
+      boost::shared_ptr<CFieldGroup> group
+               = CObjectFactory::GetObject<CFieldGroup>(gref);
+      boost::shared_ptr<CFieldGroup> owner
+               = CObjectFactory::GetObject<CFieldGroup>
+                  (boost::polymorphic_downcast<CFieldGroup*>(this));
+
+      std::vector<boost::shared_ptr<CField> > allChildren  = group->getAllChildren();
+      std::vector<boost::shared_ptr<CField> >::iterator 
+         it = allChildren.begin(), end = allChildren.end();
+      
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<CField> child = *it;
+         if (child->hasId())
+            CGroupFactory::CreateChild(owner)->field_ref.setValue(child->getId());
+      }
+   }
+   
+   void CField::outputField(ARRAY(double,3) fieldOut)
+   {
+      map<int,ARRAY(double,1)>::iterator it;
+      for(it=data_srv.begin();it!=data_srv.end();it++)
+         grid->outputField(it->first,it->second, fieldOut) ;
+      
+   }
+   
+   void CField::outputField(ARRAY(double,2) fieldOut)
+   {
+      map<int,ARRAY(double,1)>::iterator it;
+
+      for(it=data_srv.begin();it!=data_srv.end();it++)
+      {
+         grid->outputField(it->first,it->second, fieldOut) ;
+      }
+   }
+   ///-------------------------------------------------------------------
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 306)
+++ /XIOS/trunk/src/node/field.hpp	(revision 306)
@@ -0,0 +1,222 @@
+#ifndef __XMLIO_CField__
+#define __XMLIO_CField__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+#include "functor.hpp"
+#include "functor_type.hpp"
+#include "duration.hpp"
+#include "date.hpp"
+#include "declare_group.hpp"
+#include "calendar_util.hpp"
+//#include "context.hpp"
+
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CFieldGroup;
+   class CFieldAttributes;
+   class CField;
+
+   class CFile;
+   class CGrid;
+   class CContext ;
+   ///--------------------------------------------------------------
+
+   // Declare/Define CFieldAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CField)
+#  include "field_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CField)
+
+   ///--------------------------------------------------------------
+   class CField
+      : public CObjectTemplate<CField>
+      , public CFieldAttributes
+   {
+         /// friend ///
+         friend class CFile;
+
+         /// typedef ///
+         typedef CObjectTemplate<CField>   SuperClass;
+         typedef CFieldAttributes SuperClassAttribute;
+
+      public :
+
+         typedef CFieldAttributes RelAttributes;
+         typedef CFieldGroup      RelGroup;
+
+         enum EEventId
+         {
+           EVENT_ID_UPDATE_DATA
+         } ;
+         
+         /// Constructeurs ///
+         CField(void);
+         explicit CField(const StdString & id);
+         CField(const CField & field);       // Not implemented yet.
+         CField(const CField * const field); // Not implemented yet.
+
+         /// Accesseurs ///
+               boost::shared_ptr<CField> getDirectFieldReference(void) const;
+         const boost::shared_ptr<CField> getBaseFieldReference(void)   const;
+         const std::vector<boost::shared_ptr<CField> > & getAllReference(void) const;
+
+         boost::shared_ptr<CGrid> getRelGrid(void) const ;
+         boost::shared_ptr<CFile> getRelFile(void) const ;
+
+      public :
+
+         StdSize getNStep(void) const;
+
+         const date::CDuration & getFreqOperation(void) const;
+         const date::CDuration & getFreqWrite(void) const;
+
+         boost::shared_ptr<date::CDate> getLastWriteDate(void) const;
+         boost::shared_ptr<date::CDate> getLastOperationDate(void) const;
+
+         boost::shared_ptr<func::CFunctor> getFieldOperation(void) const;
+         
+         ARRAY(double, 1) getData(void) const;
+
+         const StdString & getBaseFieldId(void) const;
+
+         /// Mutateur ///
+         void setRelFile(const boost::shared_ptr<CFile> _file);
+         void incrementNStep(void);
+
+         template <StdSize N> bool updateData(const ARRAY(double, N)   data);
+         
+         bool updateDataServer
+               (const date::CDate & currDate,
+                const std::deque<ARRAY(double, 1)> storedClient);
+ 
+       public :
+
+         /// Test ///
+         bool hasDirectFieldReference(void) const;
+
+         /// Traitements ///
+         void solveRefInheritance(void);
+         void solveGridReference(void);
+         void solveOperation(void);
+
+         virtual void fromBinary(StdIStream & is);
+
+         /// Destructeur ///
+         virtual ~CField(void);
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);
+         
+         static ENodeType GetType(void);
+         
+        template <StdSize N> void setData(const ARRAY(double, N) _data) ;
+        static bool dispatchEvent(CEventServer& event) ;
+        void sendUpdateData(void) ;
+        static void recvUpdateData(CEventServer& event) ;
+        void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers) ;
+        void writeField(void) ;
+        void outputField(ARRAY(double,3) fieldOut) ;
+        void outputField(ARRAY(double,2) fieldOut) ;
+        
+      public :
+
+         /// PropriÃ©tÃ©s privÃ©es ///
+         
+         std::vector<boost::shared_ptr<CField> > refObject;
+         boost::shared_ptr<CField> baseRefObject;
+         boost::shared_ptr<CGrid>  grid ;
+         boost::shared_ptr<CFile>  file;
+
+         date::CDuration freq_operation, freq_write;
+         date::CDuration freq_operation_srv, freq_write_srv;
+
+         StdSize nstep;
+         boost::shared_ptr<date::CDate>    last_Write, last_operation;
+         boost::shared_ptr<date::CDate>    last_Write_srv, last_operation_srv;
+         
+         boost::shared_ptr<func::CFunctor> foperation;
+         map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
+         
+         ARRAY(double, 1) data;
+         map<int,ARRAY(double,1)> data_srv ;
+
+   }; // class CField
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CFieldGroup and CFieldDefinition
+   DECLARE_GROUP(CField);
+
+   } // namespace tree
+
+   ///-----------------------------------------------------------------
+
+   template <>
+      void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void);
+
+   ///-----------------------------------------------------------------
+} // namespace xmlioserver
+
+#include "grid.hpp"
+
+namespace xmlioserver {
+namespace tree {
+
+   template <StdSize N>
+   void CField::setData(const ARRAY(double, N) _data)
+   {
+     const std::vector<boost::shared_ptr<CField> > & refField=getAllReference();
+     std::vector<boost::shared_ptr<CField> >::const_iterator  it = refField.begin(), end = refField.end();
+     
+     for (; it != end; it++) (*it)->updateData(_data) ;
+    }
+    
+   template <StdSize N>
+      bool CField::updateData(const ARRAY(double, N) _data)
+   {        
+      shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+      const date::CDate & currDate = context->getCalendar()->getCurrentDate();
+      const date::CDate opeDate      = *last_operation + freq_operation;
+      const date::CDate writeDate    = *last_Write     + freq_write;       
+
+   
+      info(50) << "CField::updateData " << currDate <<  " : send data to " << this->getBaseFieldId() << std::endl;
+      info(50) << "Next operation "  << opeDate<<std::endl;
+
+      if (opeDate <= currDate)
+      {
+         if (this->data->num_elements() != this->grid->storeIndex_client->num_elements())
+         {
+            this->data->resize(boost::extents[this->grid->storeIndex_client ->num_elements()]);
+         }
+            
+         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
+         this->grid->inputField(_data, input);          
+         (*this->foperation)(input);
+         
+         *last_operation = currDate;
+         info(50) << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 
+      }
+      
+      if (writeDate < (currDate + freq_operation))
+      {
+         this->foperation->final();
+         *last_Write = writeDate;
+         info(50) << "(*last_Write = currDate) : " << *last_Write << " = " << currDate	<< std::endl;
+         sendUpdateData() ;
+         return (true);        
+      }
+
+      return (false);
+   }
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CField__
Index: /XIOS/trunk/src/node/file.cpp
===================================================================
--- /XIOS/trunk/src/node/file.cpp	(revision 306)
+++ /XIOS/trunk/src/node/file.cpp	(revision 306)
@@ -0,0 +1,407 @@
+#include "file.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "object_factory.hpp"
+#include "object_factory_impl.hpp"
+#include "data_output.hpp"
+#include "context.hpp"
+#include "context_server.hpp"
+#include "nc4_data_output.hpp"
+
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CFile::CFile(void)
+      : CObjectTemplate<CFile>(), CFileAttributes()
+      , vFieldGroup(), data_out(), enabledFields()
+   { setVirtualFieldGroup() ;}
+
+   CFile::CFile(const StdString & id)
+      : CObjectTemplate<CFile>(id), CFileAttributes()
+      , vFieldGroup(), data_out(), enabledFields()
+   { setVirtualFieldGroup() ;}
+
+   CFile::~CFile(void)
+   { /* Ne rien faire de plus */ }
+
+   ///---------------------------------------------------------------
+
+   StdString CFile::GetName(void)   { return (StdString("file")); }
+   StdString CFile::GetDefName(void){ return (CFile::GetName()); }
+   ENodeType CFile::GetType(void)   { return (eFile); }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<io::CDataOutput> CFile::getDataOutput(void) const
+   {
+      return (data_out);
+   }
+
+   boost::shared_ptr<CFieldGroup> CFile::getVirtualFieldGroup(void) const
+   {
+      return (this->vFieldGroup);
+   }
+
+   std::vector<boost::shared_ptr<CField> > CFile::getAllFields(void) const
+   {
+      return (this->vFieldGroup->getAllChildren());
+   }
+
+   //----------------------------------------------------------------
+
+   std::vector<boost::shared_ptr<CField> > CFile::getEnabledFields
+      (int default_outputlevel, int default_level, bool default_enabled)
+   {
+      if (!this->enabledFields.empty())
+         return (this->enabledFields);
+
+      const int _outputlevel =
+         (!output_level.isEmpty()) ? output_level.getValue() : default_outputlevel;
+      std::vector<boost::shared_ptr<CField> >::iterator it;
+      this->enabledFields = this->getAllFields();
+
+      std::vector<boost::shared_ptr<CField> > newEnabledFields;
+      
+      for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ )
+      {
+         if (!(*it)->enabled.isEmpty()) // Si l'attribut 'enabled' est dÃ©fini ...
+         {
+            if (! (*it)->enabled.getValue()) continue;
+//            { it--; this->enabledFields.erase(it+1); continue; }
+         }
+         else // Si l'attribut 'enabled' n'est pas dÃ©fini ...
+         {
+            if (!default_enabled) continue ;
+//            { it--; this->enabledFields.erase(it+1); continue; }
+         }
+
+         if (!(*it)->level.isEmpty()) // Si l'attribut 'level' est dÃ©fini ...
+         {
+            if ((*it)->level.getValue() > _outputlevel) continue ;
+//            { it--; this->enabledFields.erase(it+1); continue; }
+         }
+         else // Si l'attribut 'level' n'est pas dÃ©fini ...
+         {
+            if (default_level > _outputlevel) continue ;
+//            { it--; this->enabledFields.erase(it+1); continue; }
+         }
+ 
+//         CField* field_tmp=(*it).get() ;
+//         shared_ptr<CField> sptfield=*it ;
+//         field_tmp->refObject.push_back(sptfield) ;
+         newEnabledFields.push_back(*it) ;
+         // Le champ est finalement actif, on y ajoute sa propre reference.
+         (*it)->refObject.push_back(*it);
+         // Le champ est finalement actif, on y ajoute la rÃ©fÃ©rence au champ de base.
+         (*it)->setRelFile(CObjectFactory::GetObject(this));
+         (*it)->baseRefObject->refObject.push_back(*it);
+         // A faire, ajouter les references intermediaires...
+      }
+      enabledFields=newEnabledFields ;
+
+      return (this->enabledFields);
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup)
+   { 
+      this->vFieldGroup = newVFieldGroup; 
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::setVirtualFieldGroup(void)
+   {
+      this->setVirtualFieldGroup
+         (CObjectFactory::CreateObject<CFieldGroup>());
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::createHeader(void)
+   {
+    
+      std::vector<boost::shared_ptr<CField> >::iterator it, end = this->enabledFields.end();
+
+      AllDomainEmpty=true ;
+      for (it = this->enabledFields.begin() ;it != end; it++)
+      {
+         boost::shared_ptr<CField> field = *it;
+         AllDomainEmpty&=field->grid->domain->isEmpty() ;
+      }
+      
+      if (!AllDomainEmpty ||  type.getValue()=="one_file")
+      {
+         StdString filename = (!name.isEmpty()) ?   name.getValue() : getId();
+         StdOStringStream oss;
+//         if (! output_dir.isEmpty()) oss << output_dir.getValue();
+         oss << filename;
+         if (!name_suffix.isEmpty()) oss << name_suffix.getValue();
+
+         bool multifile=true ;
+         if (!type.isEmpty())
+         {
+           if (type.getValue()=="one_file") multifile=false ;
+           else if (type.getValue()=="multi_file") multifile=true ;
+           else ERROR("void Context::createDataOutput(void)",
+                      "incorrect file <type> attribut : must be <multi_file> or <one_file>, "
+                      <<"having : <"<<type.getValue()<<">") ;
+         } 
+         
+         shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+         CContextServer* server=context->server ;
+
+         if (multifile) 
+         {
+            if (server->intraCommSize > 1) oss << "_" << server->intraCommRank;
+         }
+         oss << ".nc";
+
+         data_out=shared_ptr<io::CDataOutput>(new io::CNc4DataOutput(oss.str(), false,server->intraComm,multifile));
+
+         data_out->writeFile(CObjectFactory::GetObject<CFile>(this));
+         for (it = this->enabledFields.begin() ;it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            this->data_out->writeFieldGrid(field);
+         }
+         
+         for (it = this->enabledFields.begin() ;it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            this->data_out->writeField(field);
+         }
+         
+         this->data_out->definition_end();
+      }
+   }
+
+   void CFile::close(void)
+   {
+     if (!AllDomainEmpty ||  type.getValue()=="one_file")
+       this->data_out->closeFile();
+   }
+   //----------------------------------------------------------------
+
+   void CFile::parse(xml::CXMLNode & node)
+   {
+      SuperClass::parse(node);
+      if (node.goToChildElement() & this->hasId())
+      { // Si la dÃ©finition du fichier intÃ©gre des champs et si le fichier est identifiÃ©.
+         node.goToParentElement();
+//         this->setVirtualFieldGroup(this->getId());
+         this->getVirtualFieldGroup()->parse(node, false);
+      }
+   }
+   //----------------------------------------------------------------
+
+   StdString CFile::toString(void) const
+   {
+      StdOStringStream oss;
+
+      oss << "<" << CFile::GetName() << " ";
+      if (this->hasId())
+         oss << " id=\"" << this->getId() << "\" ";
+      oss << SuperClassAttribute::toString() << ">" << std::endl;
+      if (this->getVirtualFieldGroup().get() != NULL)
+         oss << *this->getVirtualFieldGroup() << std::endl;
+      oss << "</" << CFile::GetName() << " >";
+      return (oss.str());
+   }
+
+   //----------------------------------------------------------------
+   
+   void CFile::solveDescInheritance(const CAttributeMap * const parent)
+   {
+      SuperClassAttribute::setAttributes(parent);
+      this->getVirtualFieldGroup()->solveDescInheritance(NULL);
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::solveFieldRefInheritance(void)
+   {
+      // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence de chacun des champs contenus dans le fichier.
+      std::vector<boost::shared_ptr<CField> > allF = this->getAllFields();
+      for (unsigned int i = 0; i < allF.size(); i++)
+         allF[i]->solveRefInheritance();
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::solveEFGridRef(void)
+   {
+      for (unsigned int i = 0; i < this->enabledFields.size(); i++)
+         this->enabledFields[i]->solveGridReference();
+   }
+
+   //----------------------------------------------------------------
+
+   void CFile::solveEFOperation(void)
+   {
+      for (unsigned int i = 0; i < this->enabledFields.size(); i++)
+         this->enabledFields[i]->solveOperation();
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CFile::toBinary  (StdOStream & os) const
+   {
+      ENodeType genum = CFileGroup::GetType();
+      bool hasVFG = (this->getVirtualFieldGroup().get() != NULL);
+      SuperClass::toBinary(os);
+      
+      os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType));
+      os.write (reinterpret_cast<const char*>(&hasVFG) , sizeof(bool));
+      
+      if (hasVFG)this->getVirtualFieldGroup()->toBinary(os);
+         
+   }
+   
+   //----------------------------------------------------------------
+   
+   void CFile::fromBinary(StdIStream & is)
+   {
+      ENodeType renum = Unknown;
+      bool hasVFG = false;
+      SuperClass::fromBinary(is);
+      
+      is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType));
+      is.read (reinterpret_cast<char*>(&hasVFG), sizeof(bool));
+      
+      if (renum != CFileGroup::GetType())
+         ERROR("CFile::fromBinary(StdIStream & is)",
+               << "[ renum = " << renum << "] Bad type !");
+      
+//      this->setVirtualFieldGroup(this->getId());
+      if (hasVFG)this->getVirtualFieldGroup()->fromBinary(is);
+      
+   }
+   
+   shared_ptr<CField> CFile::addField(const string& id)
+   {
+     return vFieldGroup->createChild(id) ;
+   }
+
+   shared_ptr<CFieldGroup> CFile::addFieldGroup(const string& id)
+   {
+     return vFieldGroup->createChildGroup(id) ;
+   }
+   
+  
+   void CFile::sendAddField(const string& id)
+   {
+    shared_ptr<CContext> context=CContext::current() ;
+    
+    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 ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   void CFile::sendAddFieldGroup(const string& id)
+   {
+    shared_ptr<CContext> context=CContext::current() ;
+    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 ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   void CFile::recvAddField(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddField(*buffer) ;
+   }
+   
+   
+   void CFile::recvAddField(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addField(id) ;
+   }
+
+   void CFile::recvAddFieldGroup(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddFieldGroup(*buffer) ;
+   }
+   
+   
+   void CFile::recvAddFieldGroup(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addFieldGroup(id) ;
+   }
+   
+
+   bool CFile::dispatchEvent(CEventServer& event)
+   {
+      if (SuperClass::dispatchEvent(event)) return true ;
+      else
+      {
+        switch(event.type)
+        {
+           case EVENT_ID_ADD_FIELD :
+             recvAddField(event) ;
+             return true ;
+             break ;
+         
+           case EVENT_ID_ADD_FIELD_GROUP :
+             recvAddFieldGroup(event) ;
+             return true ;
+             break ;       
+         
+           default :
+              ERROR("bool CFile::dispatchEvent(CEventServer& event)", <<"Unknown Event") ;
+           return false ;
+        }
+      }
+   }
+   
+   
+   
+   
+   ///---------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/file.hpp
===================================================================
--- /XIOS/trunk/src/node/file.hpp	(revision 306)
+++ /XIOS/trunk/src/node/file.hpp	(revision 306)
@@ -0,0 +1,124 @@
+#ifndef __XMLIO_CFile__
+#define __XMLIO_CFile__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "field.hpp"
+#include "data_output.hpp"
+#include "declare_group.hpp"
+
+
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CFileGroup;
+   class CFileAttributes;
+   class CFile;
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CFileAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CFile)
+#  include "file_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CFile)
+
+   ///--------------------------------------------------------------
+
+   class CFile
+      : public CObjectTemplate<CFile>
+      , public CFileAttributes
+   {
+         /// typedef ///
+         typedef CObjectTemplate<CFile>   SuperClass;
+         typedef CFileAttributes SuperClassAttribute;
+      
+      public :
+         enum EEventId
+         {
+           EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP
+         } ;
+         
+         typedef CFileAttributes RelAttributes;
+         typedef CFileGroup      RelGroup;
+
+         /// Constructeurs ///
+         CFile(void);
+         explicit CFile(const StdString & id);
+         CFile(const CFile & file);       // Not implemented yet.
+         CFile(const CFile * const file); // Not implemented yet.
+
+         /// Accesseurs ///
+         boost::shared_ptr<io::CDataOutput> getDataOutput(void) const;
+         boost::shared_ptr<CFieldGroup> getVirtualFieldGroup(void) const;
+         std::vector<boost::shared_ptr<CField> > getAllFields(void) const;
+
+         std::vector<boost::shared_ptr<CField> >
+            getEnabledFields(int default_outputlevel = 5,
+                             int default_level = 1,
+                             bool default_enabled = true);
+
+      public :
+
+         /// Mutateurs ///
+         void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup);
+         void setVirtualFieldGroup(void);
+
+         void createHeader(void);
+         void close(void) ;
+         
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+         void solveFieldRefInheritance(void);
+         void solveEFGridRef(void);
+         void solveEFOperation(void);
+
+         /// Destructeur ///
+         virtual ~CFile(void);
+
+         /// Autres ///
+         virtual void parse(xml::CXMLNode & node);
+         virtual StdString toString(void) const;
+         
+         virtual void toBinary  (StdOStream & os) const;
+         virtual void fromBinary(StdIStream & is);
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);
+         
+         static ENodeType GetType(void);
+         
+         bool AllDomainEmpty ;
+         shared_ptr<CField> addField(const string& id="") ;
+         shared_ptr<CFieldGroup> addFieldGroup(const string& id="") ;
+         void sendAddField(const string& id="") ;
+         void sendAddFieldGroup(const string& id="") ;
+         static void recvAddField(CEventServer& event) ;
+         void recvAddField(CBufferIn& buffer) ;
+         static void recvAddFieldGroup(CEventServer& event) ;
+         void recvAddFieldGroup(CBufferIn& buffer) ;
+         static bool dispatchEvent(CEventServer& event) ;
+
+      private :
+
+         /// PropriÃ©tÃ©s privÃ©es ///
+         boost::shared_ptr<CFieldGroup> vFieldGroup;
+         boost::shared_ptr<io::CDataOutput> data_out;
+         std::vector<boost::shared_ptr<CField> > enabledFields;
+
+   }; // class CFile
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CFileGroup and CFileDefinition
+   DECLARE_GROUP(CFile);
+
+   ///--------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CFile__
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 306)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 306)
@@ -0,0 +1,703 @@
+
+#include "grid.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include <iostream>
+#include "mpi_manager.hpp"
+
+namespace xmlioserver {
+namespace tree {
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CGrid::CGrid(void)
+      : CObjectTemplate<CGrid>(), CGridAttributes()
+      , withAxis(false), isChecked(false), axis(), domain()
+      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1)
+   { /* Ne rien faire de plus */ }
+
+   CGrid::CGrid(const StdString & id)
+      : CObjectTemplate<CGrid>(id), CGridAttributes()
+      , withAxis(false), isChecked(false), axis(), domain()
+      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1)
+   { /* Ne rien faire de plus */ }
+
+   CGrid::~CGrid(void)
+   { 
+      this->axis.reset() ;
+      this->domain.reset() ;
+      
+      for (StdSize i = 0; i < this->storeIndex.size(); i++)
+      {
+         this->storeIndex[i].reset();
+         this->out_i_index[i].reset();
+         this->out_j_index[i].reset();
+         this->out_l_index[i].reset();
+      }
+   }
+
+   ///---------------------------------------------------------------
+
+   StdString CGrid::GetName(void)    { return (StdString("grid")); }
+   StdString CGrid::GetDefName(void) { return (CGrid::GetName()); }
+   ENodeType CGrid::GetType(void)    { return (eGrid); }
+
+   //----------------------------------------------------------------
+
+   const std::deque<ARRAY(int, 1)> & CGrid::getStoreIndex(void) const
+   { 
+      return (this->storeIndex );
+   }
+
+   //---------------------------------------------------------------
+
+   const std::deque<ARRAY(int, 1)> & CGrid::getOutIIndex(void)  const
+   { 
+      return (this->out_i_index ); 
+   }
+
+   //---------------------------------------------------------------
+
+   const std::deque<ARRAY(int, 1)> & CGrid::getOutJIndex(void)  const
+   { 
+      return (this->out_j_index ); 
+   }
+
+   //---------------------------------------------------------------
+
+   const std::deque<ARRAY(int, 1)> & CGrid::getOutLIndex(void)  const
+   { 
+      return (this->out_l_index ); 
+   }
+
+   //---------------------------------------------------------------
+
+   const boost::shared_ptr<CAxis>   CGrid::getRelAxis  (void) const
+   { 
+      return (this->axis ); 
+   }
+
+   //---------------------------------------------------------------
+
+   const boost::shared_ptr<CDomain> CGrid::getRelDomain(void) const
+   { 
+      return (this->domain ); 
+   }
+
+   //---------------------------------------------------------------
+
+   bool CGrid::hasAxis(void) const 
+   { 
+      return (this->withAxis); 
+   }
+
+   //---------------------------------------------------------------
+
+   StdSize CGrid::getDimension(void) const
+   {
+      return ((this->withAxis)?3:2);
+   }
+
+   //---------------------------------------------------------------
+
+   std::vector<StdSize> CGrid::getLocalShape(void) const
+   {
+      std::vector<StdSize> retvalue;
+      retvalue.push_back(domain->zoom_ni_loc.getValue());
+      retvalue.push_back(domain->zoom_nj_loc.getValue());
+      if (this->withAxis)
+         retvalue.push_back(this->axis->size.getValue());
+      return (retvalue);
+   }
+   //---------------------------------------------------------------
+   
+   StdSize CGrid::getLocalSize(void) const
+   {
+      StdSize retvalue = 1;
+      std::vector<StdSize> shape_ = this->getLocalShape();
+      for (StdSize s = 0; s < shape_.size(); s++)
+         retvalue *= shape_[s];
+      return (retvalue);
+   }
+   
+   //---------------------------------------------------------------
+
+   std::vector<StdSize> CGrid::getGlobalShape(void) const
+   {
+      std::vector<StdSize> retvalue;
+      retvalue.push_back(domain->ni.getValue());
+      retvalue.push_back(domain->nj.getValue());
+      if (this->withAxis)
+         retvalue.push_back(this->axis->size.getValue());
+      return (retvalue);
+   }
+   //---------------------------------------------------------------
+   
+   StdSize CGrid::getGlobalSize(void) const
+   {
+      StdSize retvalue = 1;
+      std::vector<StdSize> shape_ = this->getGlobalShape();
+      for (StdSize s = 0; s < shape_.size(); s++)
+         retvalue *= shape_[s];
+      return (retvalue);
+   }
+
+   StdSize CGrid::getDataSize(void) const
+   {
+      StdSize retvalue ;
+      retvalue=domain->data_ni.getValue() ;
+      if (domain->data_dim.getValue()==2) retvalue*=domain->data_nj.getValue() ;
+      if (this->withAxis) retvalue*=this->axis->size.getValue() ;
+
+      return (retvalue);
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::solveReference(void)
+   {
+      if (this->isChecked) return;
+      shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+      CContextClient* client=context->client ;
+      
+      this->solveDomainRef() ;
+      this->solveAxisRef() ;
+      if (context->hasClient)
+      {
+         
+         this->computeIndex() ;
+         ARRAY_CREATE(storeIndex_ , int, 1, [0]);
+         ARRAY_CREATE(out_l_index_, int, 1, [0]);
+         ARRAY_CREATE(out_i_index_, int, 1, [0]);
+         ARRAY_CREATE(out_j_index_, int, 1, [0]);
+                 
+         this->storeIndex .push_front(storeIndex_);
+         this->out_i_index.push_front(out_i_index_);
+         this->out_j_index.push_front(out_j_index_);
+         this->out_l_index.push_front(out_l_index_);
+      }
+//      this->computeIndexServer();
+      this->isChecked = true;
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::solveDomainRef(void)
+   {
+      if (!domain_ref.isEmpty())
+      {
+         if (CObjectFactory::HasObject<CDomain>(domain_ref.getValue()))
+         {
+            this->domain = CObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;
+            domain->checkAttributes() ;
+         }
+         else ERROR("CGrid::solveDomainRef(void)",
+                     << "RÃ©fÃ©rence au domaine incorrecte") ;
+      }
+      else ERROR("CGrid::solveDomainRef(void)",
+                  << "Domaine non dÃ©fini") ;
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::solveAxisRef(void)
+   {
+      if (!axis_ref.isEmpty())
+      {
+         this->withAxis = true ;
+         if (CObjectFactory::GetObject<CAxis>(axis_ref.getValue()))
+         {
+            this->axis = CObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;
+            axis->checkAttributes() ;
+         }
+         else ERROR("CGrid::solveAxisRef(void)",
+                    << "RÃ©fÃ©rence a l'axe incorrecte") ;
+      }
+      else withAxis = false ;
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::computeIndex(void)
+   {    
+   
+      const int ni   = domain->ni.getValue() ,
+                nj   = domain->nj.getValue() ,
+                size = (this->hasAxis()) ? axis->size.getValue() : 1 ;
+
+
+      const int data_dim     = domain->data_dim.getValue() ,
+                data_n_index = domain->data_n_index.getValue() ,
+                data_ibegin  = domain->data_ibegin.getValue() ,
+                data_jbegin  = (data_dim == 2)
+                             ? domain->data_jbegin.getValue() : -1;
+
+      ARRAY(int, 1) data_i_index = domain->data_i_index.getValue() ,
+                    data_j_index = domain->data_j_index.getValue() ;
+
+
+      ARRAY(bool, 2) mask = domain->mask.getValue() ;
+      ARRAY(int, 2) local_mask =  this->domain->getLocalMask();
+
+      int indexCount = 0;
+
+      for(int l = 0; l < size ; l++)
+      {
+         for(int n = 0, i = 0, j = 0; n < data_n_index; n++)
+         {
+            int temp_i = (*data_i_index)[n] + data_ibegin,
+                temp_j = (data_dim == 1) ? -1
+                       : (*data_j_index)[n] + data_jbegin;
+            i = (data_dim == 1) ? (temp_i - 1) % ni
+                                : (temp_i - 1) ;
+            j = (data_dim == 1) ? (temp_i - 1) / ni
+                                : (temp_j - 1) ;
+
+            if ((i >= 0 && i < ni) &&
+                (j >= 0 && j < nj) && (*mask)[i][j])
+               indexCount++ ;
+         }
+      }
+      
+      ARRAY_ASSIGN(this->storeIndex[0] , int, 1, [indexCount]);
+      ARRAY_ASSIGN(this->out_l_index[0], int, 1, [indexCount]);
+      ARRAY_ASSIGN(this->out_i_index[0], int, 1, [indexCount]);
+      ARRAY_ASSIGN(this->out_j_index[0], int, 1, [indexCount]);
+      
+      ARRAY_ASSIGN(storeIndex_client,int,1,[indexCount]);
+      ARRAY_ASSIGN(out_i_client,int,1,[indexCount]);
+      ARRAY_ASSIGN(out_j_client,int,1,[indexCount]);
+      ARRAY_ASSIGN(out_l_client,int,1,[indexCount]);
+      
+      
+      for(int count = 0, indexCount = 0,  l = 0; l < size; l++)
+      {
+         for(int n = 0, i = 0, j = 0; n < data_n_index; n++, count++)
+         {
+            int temp_i = (*data_i_index)[n] + data_ibegin,
+                temp_j = (data_dim == 1) ? -1
+                       : (*data_j_index)[n] + data_jbegin;
+            i = (data_dim == 1) ? (temp_i - 1) % ni
+                                : (temp_i - 1) ;
+            j = (data_dim == 1) ? (temp_i - 1) / ni
+                                : (temp_j - 1) ;
+
+            if ((i >= 0 && i < ni) &&
+                (j >= 0 && j < nj) && (*mask)[i][j])
+            {
+               (*this->storeIndex[0]) [indexCount] = count ;
+               (*this->out_l_index[0])[indexCount] = l ;
+               (*this->out_i_index[0])[indexCount] = i ;
+               (*this->out_j_index[0])[indexCount] = j ;
+               
+               (*storeIndex_client)[indexCount] = count ;
+               (*out_i_client)[indexCount]=i+domain->ibegin_client-1 ;
+               (*out_j_client)[indexCount]=j+domain->jbegin_client-1 ;
+               (*out_l_client)[indexCount]=l ;
+               indexCount++ ;
+            }
+         }
+      }
+      sendIndex() ;
+
+
+   }
+
+   //----------------------------------------------------------------
+
+   boost::shared_ptr<CGrid>
+      CGrid::CreateGrid(boost::shared_ptr<CDomain> domain)
+   {
+      StdString new_id = StdString("__") + domain->getId() + StdString("__") ;
+      boost::shared_ptr<CGrid> grid =
+         CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id);
+      grid->domain_ref.setValue(domain->getId());
+      return (grid);
+   }
+
+   boost::shared_ptr<CGrid>
+      CGrid::CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis)
+   {
+      StdString new_id = StdString("__") + domain->getId() +
+                         StdString("_") + axis->getId() + StdString("__") ;
+      boost::shared_ptr<CGrid> grid =
+         CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id);
+      grid->domain_ref.setValue(domain->getId());
+      grid->axis_ref.setValue(axis->getId());
+      return (grid);
+   }
+
+   //----------------------------------------------------------------
+
+   void CGrid::outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 3) field) 
+   {
+      ARRAY(int,1) out_i=out_i_fromClient[rank] ;
+      ARRAY(int,1) out_j=out_j_fromClient[rank] ;
+      ARRAY(int,1) out_l=out_l_fromClient[rank] ;
+      
+      for(StdSize n = 0; n < stored->num_elements(); n++)
+         (*field)[(*out_i)[n]][(*out_j)[n]][(*out_l)[n]] = (*stored)[n] ;
+   }
+
+   void CGrid::outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 2) field) 
+   {
+      ARRAY(int,1) out_i=out_i_fromClient[rank] ;
+      ARRAY(int,1) out_j=out_j_fromClient[rank] ;
+
+       for(StdSize n = 0; n < stored->num_elements(); n++)
+         (*field)[(*out_i)[n]][(*out_j)[n]] = (*stored)[n] ;
+   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::outputField(int rank,const ARRAY(double, 1) stored,  ARRAY(double, 1) field)
+   {
+      ARRAY(int,1) out_i = out_i_fromClient[rank] ;
+      for(StdSize n = 0; n < stored->num_elements(); n++)
+         (*field)[(*out_i)[n]] = (*stored)[n] ;
+   }
+
+   //----------------------------------------------------------------
+  
+
+   void CGrid::storeField_arr
+      (const double * const data, ARRAY(double, 1) stored) const
+   {
+      const StdSize size = (this->storeIndex_client)->num_elements() ;
+
+      stored->resize(boost::extents[size]) ;
+      for(StdSize i = 0; i < size; i++)
+         (*stored)[i] = data[(*storeIndex_client)[i]] ;
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CGrid::toBinary  (StdOStream & os) const
+   {
+      SuperClass::toBinary(os);
+     
+      os.write (reinterpret_cast<const char*>(&this->isChecked), sizeof(bool)); 
+     
+      if (this->isChecked)
+      {
+         this->storeIndex [0]->toBinary(os);
+         this->out_i_index[0]->toBinary(os);
+         this->out_j_index[0]->toBinary(os);
+         this->out_l_index[0]->toBinary(os);
+      }
+   }
+
+   //---------------------------------------------------------------
+   
+   void CGrid::fromBinary(StdIStream & is)
+   {
+      bool hasIndex = false;
+      SuperClass::fromBinary(is);            
+      is.read (reinterpret_cast<char*>(&hasIndex), sizeof(bool)); 
+      
+      if (hasIndex)
+      {
+         ARRAY_CREATE(storeIndex_ , int, 1, [0]);
+         ARRAY_CREATE(out_l_index_, int, 1, [0]);
+         ARRAY_CREATE(out_i_index_, int, 1, [0]);
+         ARRAY_CREATE(out_j_index_, int, 1, [0]);
+         
+         storeIndex_ ->fromBinary(is);
+         out_i_index_->fromBinary(is);
+         out_j_index_->fromBinary(is);
+         out_l_index_->fromBinary(is);
+         
+         this->storeIndex .push_back(storeIndex_);
+         this->out_i_index.push_back(out_i_index_);
+         this->out_j_index.push_back(out_j_index_);
+         this->out_l_index.push_back(out_l_index_);
+      }
+   }
+   
+   //---------------------------------------------------------------
+  void CGrid::sendIndex(void)
+  {
+    shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+    CContextClient* client=context->client ;
+    
+    CEventClient event(getType(),EVENT_ID_INDEX) ;
+    int rank ;
+    list<shared_ptr<CMessage> > list_msg ;
+    list<ARRAY(int,1) > list_out_i,list_out_j,list_out_l ;
+     
+    for(int ns=0;ns<domain->connectedServer.size();ns++)
+    {
+       rank=domain->connectedServer[ns] ;
+       int ib=domain->ib_srv[ns] ;
+       int ie=domain->ie_srv[ns] ;
+       int jb=domain->jb_srv[ns] ;
+       int je=domain->je_srv[ns] ;
+       
+       int i,j ;
+       int nb=0 ;
+       for(int k=0;k<storeIndex_client->num_elements();k++)
+       {
+         i=(*out_i_client)[k] ;
+         j=(*out_j_client)[k] ;
+         if (i>=ib-1 && i<=ie-1 && j>=jb-1 && j<=je-1) nb++ ; 
+       }
+       
+       ARRAY_CREATE(storeIndex,int,1,[nb]) ;
+       ARRAY_CREATE(out_i,int,1,[nb]) ;
+       ARRAY_CREATE(out_j,int,1,[nb]) ;
+       ARRAY_CREATE(out_l,int,1,[nb]) ;
+       
+       nb=0 ;
+       for(int k=0;k<storeIndex_client->num_elements();k++)
+       {
+         i=(*out_i_client)[k] ;
+         j=(*out_j_client)[k] ;
+         if (i>=ib-1 && i<=ie-1 && j>=jb-1 && j<=je-1) 
+         {
+            (*storeIndex)[nb]=k ;
+            (*out_i)[nb]=(*out_i_client)[k] ;
+            (*out_j)[nb]=(*out_j_client)[k] ;
+            (*out_l)[nb]=(*out_l_client)[k] ;
+            nb++ ;
+         }
+       }
+       
+       storeIndex_toSrv.insert(pair<int,ARRAY(int,1) >(rank,storeIndex)) ;
+       nbSenders.insert(pair<int,int>(rank,domain->nbSenders[ns])) ;
+       list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
+       list_out_i.push_back(out_i) ;
+       list_out_j.push_back(out_j) ;
+       list_out_l.push_back(out_l) ;
+
+       *list_msg.back()<<getId()<<list_out_i.back()<<list_out_j.back()<<list_out_l.back() ;
+       event.push(rank,domain->nbSenders[ns],*list_msg.back()) ;
+    }
+    client->sendEvent(event) ;
+  }
+  
+  void CGrid::recvIndex(CEventServer& event)
+  {
+    list<CEventServer::SSubEvent>::iterator it ;
+    for (it=event.subEvents.begin();it!=event.subEvents.end();++it)
+    {
+      int rank=it->rank;
+      CBufferIn* buffer=it->buffer;
+      string domainId ;
+      *buffer>>domainId ;
+      get(domainId)->recvIndex(rank,*buffer) ;
+    }
+  }
+  
+  void CGrid::recvIndex(int rank, CBufferIn& buffer)
+  {
+    ARRAY_CREATE(out_i,int,1,[0]) ;
+    ARRAY_CREATE(out_j,int,1,[0]) ;
+    ARRAY_CREATE(out_l,int,1,[0]) ;
+    
+    buffer>>out_i>>out_j>>out_l ;
+    int offset ;
+    
+    offset=domain->zoom_ibegin_srv-1 ;
+    for(int k=0;k<out_i->num_elements();k++) (*out_i)[k]=(*out_i)[k]-offset ;
+    
+    offset=domain->zoom_jbegin_srv-1 ;
+    for(int k=0;k<out_i->num_elements();k++) (*out_j)[k]=(*out_j)[k]-offset ;
+    
+    out_i_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_i)) ;
+    out_j_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_j)) ;
+    out_l_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_l)) ;
+  }
+
+  bool CGrid::dispatchEvent(CEventServer& event)
+  {
+     
+    if (SuperClass::dispatchEvent(event)) return true ;
+    else
+    {
+      switch(event.type)
+      {
+        case EVENT_ID_INDEX :
+          recvIndex(event) ;
+          return true ;
+          break ;
+ 
+        default :
+          ERROR("bool CDomain::dispatchEvent(CEventServer& event)",
+                <<"Unknown Event") ;
+          return false ;
+      }
+    }
+  }
+
+
+
+   void CGrid::computeIndexServer(void)
+   {
+      ARRAY(int, 2) local_mask =  this->domain->getLocalMask();
+      
+      const std::vector<int> & ibegin = this->domain->getIBeginSub();
+      const std::vector<int> & jbegin = this->domain->getJBeginSub();
+      const std::vector<int> & iend = this->domain->getIEndSub();
+      const std::vector<int> & jend = this->domain->getJEndSub();
+      const std::vector<int> & ibegin_zoom = this->domain->getIBeginZoomSub();
+      const std::vector<int> & jbegin_zoom = this->domain->getJBeginZoomSub();
+      const std::vector<int> & ni_zoom = this->domain->getNiZoomSub();
+      const std::vector<int> & nj_zoom = this->domain->getNjZoomSub();
+      
+      const int ibegin_srv  = this->domain->ibegin.getValue();
+      const int jbegin_srv  = this->domain->jbegin.getValue();
+      const int iend_srv  = this->domain->iend.getValue();
+      const int jend_srv  = this->domain->jend.getValue();
+      const int zoom_ni_srv = this->domain->zoom_ni_loc.getValue();
+      const int zoom_nj_srv = this->domain->zoom_nj_loc.getValue();
+      
+      const int ibegin_zoom_srv = this->domain->zoom_ibegin_loc.getValue();
+      const int jbegin_zoom_srv = this->domain->zoom_jbegin_loc.getValue();
+       const int iend_zoom_srv = ibegin_zoom_srv + zoom_ni_srv-1 ;
+      const int  jend_zoom_srv = jbegin_zoom_srv + zoom_nj_srv-1 ;
+        
+      StdSize dn = 0;      
+      for (StdSize j = 1; j < this->out_i_index.size(); j++)
+         dn += this->out_i_index[j]->size();
+         
+      ARRAY_CREATE(storeIndex_srv , int, 1, [dn]);
+      ARRAY_CREATE(out_i_index_srv, int, 1, [dn]);
+      ARRAY_CREATE(out_j_index_srv, int, 1, [dn]);
+      ARRAY_CREATE(out_l_index_srv, int, 1, [dn]);
+      
+      for (StdSize i = 0, dn = 0; i < ibegin.size(); i++)
+      {
+         ARRAY(int, 1) storeIndex_cl   =  this->storeIndex [i + 1];
+         ARRAY(int, 1) out_i_index_cl  =  this->out_i_index[i + 1];
+         ARRAY(int, 1) out_j_index_cl  =  this->out_j_index[i + 1];
+         ARRAY(int, 1) out_l_index_cl  =  this->out_l_index[i + 1];
+                 
+         int ibegin_zoom_cl = ibegin[i]; //ibegin_zoom[i];
+         int jbegin_zoom_cl = jbegin[i]; //jbegin_zoom[i];
+         int iend_zoom_cl = iend[i]; //ibegin_zoom[i];
+         int jend_zoom_cl = jend[i]; //jbegin_zoom[i];
+
+         int ibegin_cl = ibegin[i]; //ibegin[i];
+         int jbegin_cl = jbegin[i]; //jbegin[i];
+         int iend_cl = iend[i]; //ibegin[i];
+         int jend_cl = jend[i]; //jbegin[i];
+         
+         if (ibegin_zoom.size() != 0)
+         {
+            ibegin_zoom_cl = ibegin_zoom[i];
+            jbegin_zoom_cl = jbegin_zoom[i];
+            iend_zoom_cl = ibegin_zoom[i]+ni_zoom[i]-1;
+            jend_zoom_cl = jbegin_zoom[i]+nj_zoom[i]-1;
+         }
+         
+
+         if (comm::CMPIManager::IsClient())
+         {
+           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
+           {
+              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
+
+              (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1 - (ibegin_srv + ibegin_zoom_srv - 1) + 1 ;
+              (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1 - (jbegin_srv + jbegin_zoom_srv - 1) + 1 ;
+              (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
+           }
+         }
+         else
+         {
+           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
+           {
+              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
+            (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 
+                                   + (ibegin_cl - 1) - (ibegin_srv - 1) + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);
+            (*out_j_index_srv)[n] = (*out_j_index_cl)[m]
+                                   + (jbegin_cl - 1) - (jbegin_srv - 1) + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);
+            (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
+           }         
+            
+         }
+                  
+         dn += storeIndex_cl->size(); 
+      }
+      
+      if (storeIndex_srv->size() != 0)
+      {
+         const int ibegin_t = 
+            *std::min_element(out_i_index_srv->begin(), out_i_index_srv->end());
+         const int iend_t   =
+            *std::max_element(out_i_index_srv->begin(), out_i_index_srv->end());
+         const int jbegin_t =   
+            *std::min_element(out_j_index_srv->begin(), out_j_index_srv->end());
+         const int jend_t   =
+            *std::max_element(out_j_index_srv->begin(), out_j_index_srv->end());
+               
+                                 
+         if ((ibegin_t < 0) || (jbegin_t < 0) ||
+             (iend_t >= zoom_ni_srv) || (jend_t >= zoom_nj_srv))
+         {
+            ERROR("CGrid::computeIndexServer(void)",
+                  << "[ grille = "      << this->getId()
+                  << ", ibegin_t = "    << ibegin_t
+                  << ", jbegin_t = "    << jbegin_t
+                  << ", iend_t = "      << iend_t
+                  << ", jend_t = "      << jend_t
+                  << ", zoom_ni_srv = " << zoom_ni_srv
+                  << ", zoom_nj_srv = " << zoom_nj_srv
+                  << ", nb subdomain = "   << out_i_index.size()-1
+                  <<" ] Erreur d'indexation de la grille au niveau du serveur") ;
+         }
+      }
+
+      if (storeIndex_srv->size() != 0)
+         for (StdSize u = 0; u < storeIndex_srv->size(); u++)
+            (*local_mask)[(*out_i_index_srv)[u]][(*out_j_index_srv)[u]] = 1;
+
+//      StdOFStream ofs(("log_server_"+this->getId()).c_str());
+//      for (StdSize h = 0; h < storeIndex_srv->size(); h++)
+//      {
+//        ofs << "(" << (*storeIndex_srv)[h]  << ";"
+//            << (*out_i_index_srv)[h] << ","
+//            << (*out_j_index_srv)[h] << ","
+//            << (*out_l_index_srv)[h] << ")" << std::endl;
+//      }
+//       ofs.close();
+   
+      this->storeIndex [0] = storeIndex_srv ;
+      this->out_i_index[0] = out_i_index_srv;
+      this->out_j_index[0] = out_j_index_srv;
+      this->out_l_index[0] = out_l_index_srv;      
+   }
+   
+   
+   void CGrid::inputFieldServer
+         (const std::deque<ARRAY(double, 1)> storedClient,
+                           ARRAY(double, 1)  storedServer) const
+   {
+      if ((this->storeIndex.size()-1 ) != storedClient.size())
+         ERROR("CGrid::inputFieldServer(...)",
+                << "[ Nombre de tableau attendu = " << (this->storeIndex.size()-1) << ", "
+                << "[ Nombre de tableau reÃ§u = "    << storedClient.size() << "] "
+                << "Les donnÃ©es d'un client sont manquantes !") ;
+      if (storedServer.get() != NULL)
+         storedServer->resize(boost::extents[this->storeIndex[0]->num_elements()]);
+      else 
+         ARRAY_ASSIGN(storedServer, double, 1, [this->storeIndex[0]->num_elements()]);
+         
+      for (StdSize i = 0, n = 0; i < storedClient.size(); i++)
+         for (StdSize j = 0; j < storedClient[i]->num_elements(); j++)
+            (*storedServer)[n++] = (*storedClient[i])[j];
+   }
+
+   void CGrid::outputFieldToServer(ARRAY(double, 1) fieldIn, int rank, ARRAY(double, 1) fieldOut)
+   {
+     ARRAY(int,1) index=storeIndex_toSrv[rank] ;
+     int nb=index->num_elements() ;
+     fieldOut->resize(extents[nb]) ;
+     
+     for(int k=0;k<nb;k++) (*fieldOut)[k]=(*fieldIn)[(*index)[k]] ;
+    }
+   ///---------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/grid.hpp
===================================================================
--- /XIOS/trunk/src/node/grid.hpp	(revision 306)
+++ /XIOS/trunk/src/node/grid.hpp	(revision 306)
@@ -0,0 +1,183 @@
+#ifndef __XMLIO_CGrid__
+#define __XMLIO_CGrid__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "declare_group.hpp"
+#include "domain.hpp"
+#include "axis.hpp"
+
+namespace xmlioserver {
+namespace tree {
+   
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CGridGroup;
+   class CGridAttributes;
+   class CGrid;
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CGridAttribute
+   BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid)
+#  include "grid_attribute.conf"
+   END_DECLARE_ATTRIBUTE_MAP(CGrid)
+
+   ///--------------------------------------------------------------
+
+   class CGrid
+      : public CObjectTemplate<CGrid>
+      , public CGridAttributes
+   {
+         /// typedef ///
+         typedef CObjectTemplate<CGrid>   SuperClass;
+         typedef CGridAttributes SuperClassAttribute;
+
+      public :
+
+         typedef CGridAttributes RelAttributes;
+         typedef CGridGroup      RelGroup;
+
+         enum EEventId
+         {
+           EVENT_ID_INDEX
+         } ;
+         
+         /// Constructeurs ///
+         CGrid(void);
+         explicit CGrid(const StdString & id);
+         CGrid(const CGrid & grid);       // Not implemented yet.
+         CGrid(const CGrid * const grid); // Not implemented yet.
+
+         /// Traitements ///
+         void solveReference(void);
+
+         virtual void toBinary  (StdOStream & os) const;
+         virtual void fromBinary(StdIStream & is);
+
+         /// Tests ///
+         bool hasAxis(void) const;
+
+      public :
+
+         /// Accesseurs ///
+         const std::deque<ARRAY(int, 1)> & getStoreIndex(void) const;
+         const std::deque<ARRAY(int, 1)> & getOutIIndex(void)  const;
+         const std::deque<ARRAY(int, 1)> & getOutJIndex(void)  const;
+         const std::deque<ARRAY(int, 1)> & getOutLIndex(void)  const;
+
+         const boost::shared_ptr<CAxis>   getRelAxis  (void) const;
+         const boost::shared_ptr<CDomain> getRelDomain(void) const;
+
+         StdSize getDimension(void) const;
+         
+         StdSize getLocalSize(void) const;
+         StdSize getGlobalSize(void) const;
+         StdSize  getDataSize(void) const;
+         std::vector<StdSize> getLocalShape(void) const;
+         std::vector<StdSize> getGlobalShape(void) const;
+
+         /// EntrÃ©es-sorties de champs ///
+         template <StdSize n>
+            void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const;
+            
+         void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient,
+                                                ARRAY(double, 1)  storedServer) const;
+/*
+         template <StdSize n>
+            void outputField(const ARRAY(double, 1) stored,  ARRAY(double, n) field) const;
+*/
+         void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 3) field)  ;
+         void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 2) field)  ;
+         void outputField(int rank,const ARRAY(double, 1) stored,  ARRAY(double, 1) field)  ; 
+   
+         /// Destructeur ///
+         virtual ~CGrid(void);
+
+      public :
+
+         /// Accesseurs statiques ///
+         static StdString GetName(void);
+         static StdString GetDefName(void);
+         
+         static ENodeType GetType(void);
+
+         /// Instanciateurs Statiques ///
+         static boost::shared_ptr<CGrid>
+            CreateGrid(boost::shared_ptr<CDomain> domain);
+         static boost::shared_ptr<CGrid>
+            CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis);
+
+      public :
+
+         /// EntrÃ©es-sorties de champs (interne) ///
+         void storeField_arr(const double * const data, ARRAY(double, 1) stored) const;
+
+         /// Traitements protÃ©gÃ©s ///
+         void computeIndexServer(void);
+         void computeIndex(void);
+         void solveDomainRef(void);
+         void solveAxisRef(void);
+
+         static bool dispatchEvent(CEventServer& event) ;
+         void outputFieldToServer(ARRAY(double, 1) fieldIn, int rank, ARRAY(double, 1) fieldOut) ;
+         static void recvIndex(CEventServer& event) ;
+         void recvIndex(int rank, CBufferIn& buffer) ;
+         void sendIndex(void) ;
+         
+      public:
+
+         /// PropriÃ©tÃ©s privÃ©es ///
+         bool withAxis ;
+         bool isChecked;
+
+         boost::shared_ptr<CAxis>   axis ;
+         boost::shared_ptr<CDomain> domain ;
+
+         std::deque<ARRAY(int, 1)> storeIndex ;
+         std::deque<ARRAY(int, 1)> out_i_index ;
+         std::deque<ARRAY(int, 1)> out_j_index ;
+         std::deque<ARRAY(int, 1)> out_l_index ;
+         ARRAY(int, 1) storeIndex_client ;
+         ARRAY(int, 1) out_i_client ;
+         ARRAY(int, 1) out_j_client ;
+         ARRAY(int, 1) out_l_client ;
+         
+         map<int,ARRAY(int, 1)>  storeIndex_toSrv ;
+         map<int,int> nbSenders ;
+//         std::deque<ARRAY(int, 1)> out_i_toSrv ;
+//         std::deque<ARRAY(int, 1)> out_j_toSrv ;
+//         std::deque<ARRAY(int, 1)> out_l_toSrv ;
+         
+         map<int,ARRAY(int, 1)> out_i_fromClient ;
+         map<int,ARRAY(int, 1)> out_j_fromClient ;
+         map<int,ARRAY(int, 1)> out_l_fromClient ;
+         
+   }; // class CGrid
+
+   ///--------------------------------------------------------------
+
+   template <StdSize n>
+      void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const
+   {
+      if (this->getDataSize() != field->num_elements())
+         ERROR("CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored)",
+                << "[ Taille des donnÃ©es attendue = " << this->getDataSize()       << ", "
+                << "Taille des donnÃ©es reÃ§ue = "      << field->num_elements() << " ] "
+                << "Le tableau de donnÃ©es n'a pas la bonne taille !") ;
+      this->storeField_arr(field->data(), stored) ;
+   }
+
+   ///--------------------------------------------------------------
+
+   // Declare/Define CGridGroup and CGridDefinition
+   DECLARE_GROUP(CGrid);
+
+   ///--------------------------------------------------------------
+
+} // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGrid__
Index: /XIOS/trunk/src/node/method.hpp
===================================================================
--- /XIOS/trunk/src/node/method.hpp	(revision 306)
+++ /XIOS/trunk/src/node/method.hpp	(revision 306)
@@ -0,0 +1,102 @@
+#ifndef __XMLIO_CMethod__
+#define __XMLIO_CMethod__
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CMethodGroup;
+      class CMethodAttributes;
+      class CBaseMethod;
+      class CMethod;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CMethodAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CMethod)
+#include "method_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CMethod)
+
+      ///--------------------------------------------------------------
+
+      class CBaseMethod
+      { // Declare CMethod functionalities
+         public :
+
+            /// Constructeur et Destructeur ///
+            CBaseMethod(void);
+            ~CBaseMethod(void);
+
+      }; // class CBaseMethod
+
+      ///--------------------------------------------------------------
+
+      class CMethod
+         : public CObjectTemplate<CMethod>
+         , public CMethodAttributes
+         , public CBaseMethod
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CMethod>   SuperClass;
+            typedef CMethodAttributes SuperClassAttribute;
+            typedef CBaseMethod       SuperClassBase;
+
+         public :
+
+            typedef CMethodAttributes RelAttributes;
+            typedef CMethodGroup      RelGroup;
+
+            /// Constructeurs ///
+            CMethod(void);
+            explicit CMethod(const StdString & id);
+            CMethod(const CMethod & method);       // Not implemented yet.
+            CMethod(const CMethod * const method); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CMethod(void);
+
+            /// Accesseurs statiques ///
+            static inline StdString GetName(void);
+            static inline StdString GetDefName(void);
+
+      }; // class CMethod
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CMethodGroup and CMethodDefinition
+      DECLARE_GROUP(CMethod);
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBaseMethod::CBaseMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      CBaseMethod::~CBaseMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      CMethod::CMethod(void)
+         : CObjectTemplate<CMethod>()
+         , CMethodAttributes()
+         , CBaseMethod()
+      { /* Ne rien faire de plus */ }
+
+      CMethod::CMethod(const StdString & id)
+         : CObjectTemplate<CMethod>(id)
+         , CMethodAttributes()
+         , CBaseMethod()
+      { /* Ne rien faire de plus */ }
+
+      CMethod::~CMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CMethod::GetName(void)   { return (StdString("method")); }
+      StdString CMethod::GetDefName(void){ return (CMethod::GetName()); }
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CMethod__
Index: /XIOS/trunk/src/node/node_enum.hpp
===================================================================
--- /XIOS/trunk/src/node/node_enum.hpp	(revision 306)
+++ /XIOS/trunk/src/node/node_enum.hpp	(revision 306)
@@ -0,0 +1,30 @@
+#ifndef __XMLIO_NODE_ENUM__
+#define __XMLIO_NODE_ENUM__
+
+//#define DECLARE_NODE(Name_, name_)     ,e##Name_, g##Name_
+//#define DECLARE_NODE_PAR(Name_, name_) ,e##Name_, g##Name_
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      typedef enum _node_type
+      {
+         Unknown = 0,
+         eAxis,gAxis,
+         eDomain,gDomain,
+         eField,gField,
+         eFile,gFile,
+         eGrid,gGrid,
+         eVariable,gVariable,
+         eContext,gContext
+
+//#include "node_type.conf"
+
+      } ENodeType;
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_NODE_ENUM__
Index: /XIOS/trunk/src/node/node_type.hpp
===================================================================
--- /XIOS/trunk/src/node/node_type.hpp	(revision 306)
+++ /XIOS/trunk/src/node/node_type.hpp	(revision 306)
@@ -0,0 +1,12 @@
+#ifndef __XMLIO_NODE_TYPE__
+#define __XMLIO_NODE_TYPE__
+
+#include "axis.hpp"
+#include "domain.hpp"
+#include "field.hpp"
+#include "file.hpp"
+#include "grid.hpp"
+#include "variable.hpp"
+#include "context.hpp"
+
+#endif // __XMLIO_NODE_TYPE__
Index: /XIOS/trunk/src/node/var.hpp
===================================================================
--- /XIOS/trunk/src/node/var.hpp	(revision 306)
+++ /XIOS/trunk/src/node/var.hpp	(revision 306)
@@ -0,0 +1,102 @@
+#ifndef __XMLIO_CVar__
+#define __XMLIO_CVar__
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CVarGroup;
+      class CVarAttributes;
+      class CBaseVar;
+      class CVar;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CVar)
+#include "var_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CVar)
+
+      ///--------------------------------------------------------------
+
+      class CBaseVar
+      { // Declare CVar functionalities
+         public :
+
+            /// Constructeur et Destructeur ///
+            CBaseVar(void);
+            ~CBaseVar(void);
+
+      }; // class CBaseVar
+
+      ///--------------------------------------------------------------
+
+      class CVar
+         : public CObjectTemplate<CVar>
+         , public CVarAttributes
+         , public CBaseVar
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CVar>   SuperClass;
+            typedef CVarAttributes SuperClassAttribute;
+            typedef CBaseVar       SuperClassBase;
+
+         public :
+
+            typedef CVarAttributes RelAttributes;
+            typedef CVarGroup      RelGroup;
+
+            /// Constructeurs ///
+            CVar(void);
+            explicit CVar(const StdString & id);
+            CVar(const CVar & var);       // Not implemented yet.
+            CVar(const CVar * const var); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CVar(void);
+
+            /// Accesseurs statiques ///
+            static inline StdString GetName(void);
+            static inline StdString GetDefName(void);
+
+      }; // class CVar
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarGroup and CVarDefinition
+      DECLARE_GROUP(CVar);
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBaseVar::CBaseVar(void)
+      { /* Ne rien faire de plus */ }
+
+      CBaseVar::~CBaseVar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      CVar::CVar(void)
+         : CObjectTemplate<CVar>()
+         , CVarAttributes()
+         , CBaseVar()
+      { /* Ne rien faire de plus */ }
+
+      CVar::CVar(const StdString & id)
+         : CObjectTemplate<CVar>(id)
+         , CVarAttributes()
+         , CBaseVar()
+      { /* Ne rien faire de plus */ }
+
+      CVar::~CVar(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CVar::GetName(void)   { return (StdString("var")); }
+      StdString CVar::GetDefName(void){ return (CVar::GetName()); }
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CVar__
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 306)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 306)
@@ -0,0 +1,116 @@
+#include "variable.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "object_factory.hpp"
+#include "object_factory_impl.hpp"
+
+namespace xmlioserver {
+namespace tree {
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CVariable::CVariable(void)
+      : CObjectTemplate<CVariable>()
+      , CVariableAttributes()
+      , content()
+   { /* Ne rien faire de plus */ }
+
+   CVariable::CVariable(const StdString & id)
+      : CObjectTemplate<CVariable>(id)
+      , CVariableAttributes()
+      , content()
+   { /* Ne rien faire de plus */ }
+
+   CVariable::~CVariable(void)
+   { /* Ne rien faire de plus */ }
+
+   StdString CVariable::GetName(void)   { return (StdString("variable")); }
+   StdString CVariable::GetDefName(void){ return (CVariable::GetName()); }
+   ENodeType CVariable::GetType(void)   { return (eVariable); }
+
+   void CVariable::parse(xml::CXMLNode & node)
+   {
+      SuperClass::parse(node);
+      StdString id = (this->hasId()) ? this->getId() : StdString("undefined");
+      if (!node.getContent(this->content))
+      {
+         ERROR("CVariable::parse(xml::CXMLNode & node)",
+               << "[ variable id = " << id
+               << " ] variable is not defined !");
+      }
+   }
+
+   const StdString & CVariable::getContent (void) const
+   {
+      return (this->content);
+   }
+
+   StdString CVariable::toString(void) const
+   {
+      StdOStringStream oss;
+
+      oss << "<" << CVariable::GetName() << " ";
+      if (this->hasId())
+         oss << " id=\"" << this->getId() << "\" ";
+      oss << SuperClassAttribute::toString() << ">" << std::endl
+          << this->content /*<< std::endl*/;
+      oss << "</" << CVariable::GetName() << " >";
+      return (oss.str());
+   }
+
+   void CVariable::toBinary(StdOStream & os) const
+   {
+     const StdString & content = this->content;
+     const StdSize size        =  content.size();
+     SuperClass::toBinary(os);
+
+     os.write (reinterpret_cast<const char*>(&size), sizeof(StdSize));
+     os.write (content.data(), size * sizeof(char));
+   }
+
+   void CVariable::fromBinary(StdIStream & is)
+   {
+      SuperClass::fromBinary(is);
+      StdSize size  = 0;
+      is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+      this->content.assign(size, ' ');
+      is.read (const_cast<char *>(this->content.data()), size * sizeof(char));
+   }
+
+   void CVariableGroup::parse(xml::CXMLNode & node, bool withAttr)
+   {
+      boost::shared_ptr<CVariableGroup> group_ptr = (this->hasId())
+         ? CObjectFactory::GetObject<CVariableGroup>(this->getId())
+         : CObjectFactory::GetObject(this);
+
+      StdString content;
+      if (this->getId().compare(CVariableGroup::GetDefName()) != 0 && node.getContent(content))
+      {
+        StdSize beginid = 0, endid = 0, begindata = 0, enddata = 0;
+        StdString subdata, subid;
+
+        while ((beginid = content.find_first_not_of ( " \r\n\t;", enddata)) != StdString::npos)
+        {
+           endid   = content.find_first_of ( " \r\n\t=", beginid );
+           subid   = content.substr ( beginid, endid-beginid);
+
+           begindata = content.find_first_of ( "=", endid ) + 1;
+           enddata   = content.find_first_of ( ";", begindata );
+           subdata   = content.substr ( begindata, enddata-begindata);
+
+           CGroupFactory::CreateChild(group_ptr, subid)->content = subdata;
+        }
+      }
+      else
+      {
+         SuperClass::parse(node, withAttr);
+      }
+      //SuperClass::parse(node, withAttr);
+
+   }
+
+} // namespace tree
+} // namespace xmlioserver
Index: /XIOS/trunk/src/node/variable.hpp
===================================================================
--- /XIOS/trunk/src/node/variable.hpp	(revision 306)
+++ /XIOS/trunk/src/node/variable.hpp	(revision 306)
@@ -0,0 +1,117 @@
+#ifndef __XMLIO_CVariable__
+#define __XMLIO_CVariable__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "declare_group.hpp"
+
+#include "data_output.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CVariableGroup;
+      class CVariableAttributes;
+      class CVariable;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CVariable)
+#include "var_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CVariable)
+
+      ///--------------------------------------------------------------
+
+      class CVariable
+         : public CObjectTemplate<CVariable>
+         , public CVariableAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CVariable>   SuperClass;
+            typedef CVariableAttributes SuperClassAttribute;
+
+            friend class CVariableGroup;
+
+         public :
+
+            typedef CVariableAttributes RelAttributes;
+            typedef CVariableGroup      RelGroup;
+
+            /// Constructeurs ///
+            CVariable(void);
+            explicit CVariable(const StdString & id);
+            CVariable(const CVariable & var);       // Not implemented yet.
+            CVariable(const CVariable * const var); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CVariable(void);
+
+         public :
+         
+            /// Autres ///
+            virtual void parse(xml::CXMLNode & node);
+            virtual StdString toString(void) const;
+
+            virtual void toBinary  (StdOStream & os) const;
+            virtual void fromBinary(StdIStream & is);
+
+            /// Accesseur ///
+            const StdString & getContent (void) const;
+
+            
+            template <typename T> inline T getData(void) const;
+//            bool inline getData<bool>(void) const ;
+            
+            template <typename T, StdSize N>
+               inline void getData(ARRAY(T, N) _data_array) const;
+
+         public :
+         
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+            static ENodeType GetType(void);
+
+         private :
+
+            StdString content;
+
+      }; // class CVar
+
+     
+      template <typename T>
+      T CVariable::getData(void) const
+      {
+         T retval ;
+         std::stringstream sstr(std::stringstream::in | std::stringstream::out); 
+         sstr<<content ;
+         sstr>>retval ;
+         if (sstr.fail()) ERROR("CVariable::getdata()",
+               << "Cannot convert string <" << content << "> into type required" );
+         return retval ;
+      } 
+
+      template<>
+      bool CVariable::getData<bool>(void) const
+      {
+         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 
+         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 
+         else ERROR("CVariable::getdata()",
+               << "Cannot convert string <" << content << "> into type required" );
+         return false ;
+      } 
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarGroup and CVarDefinition
+      DECLARE_GROUP_PARSE_REDEF(CVariable);
+
+
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CVariable__
Index: /XIOS/trunk/src/object.cpp
===================================================================
--- /XIOS/trunk/src/object.cpp	(revision 306)
+++ /XIOS/trunk/src/object.cpp	(revision 306)
@@ -0,0 +1,61 @@
+#include "object.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CObject::CObject(void)
+      : id(), IdDefined(false)
+   { /* Ne rien faire de plus */ }
+
+   CObject::CObject(const StdString & id)
+      : id(id), IdDefined(true)
+   { /* Ne rien faire de plus */ }
+
+   CObject::CObject(const CObject & object)
+      : id(object.id), IdDefined(object.IdDefined)
+   { /* Ne rien faire de plus */ }
+
+   CObject::~CObject(void)
+   { /* Ne rien faire de plus */ }
+
+   const StdString & CObject::getId(void) const 
+   { 
+      return (this->id);
+   }
+
+   bool CObject::hasId(void) const  
+   { 
+      return (this->IdDefined);
+   }
+
+   void CObject::resetId(void) 
+   { 
+      this->IdDefined = false ;
+   }
+
+   void CObject::setId(const StdString & id)
+   { 
+      this->id = id ;
+      this->IdDefined = true ;
+   }
+
+   bool CObject::operator==(const CObject & other) const
+   {
+      if(!this->hasId() || !other.hasId())
+         return (false);
+      return (this->id.compare(other.id) == 0);
+   }
+
+   bool CObject::operator!=(const CObject & other) const
+   { 
+      return (!(*this == other));
+   }
+
+   StdOStream & operator << (StdOStream & os, const CObject & object)
+   { 
+      os << object.toString();
+      return (os);
+   }
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/object.hpp
===================================================================
--- /XIOS/trunk/src/object.hpp	(revision 306)
+++ /XIOS/trunk/src/object.hpp	(revision 306)
@@ -0,0 +1,58 @@
+#ifndef __XMLIO_CObject__
+#define __XMLIO_CObject__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CObject
+   {
+      public :
+
+         /// Destructeur ///
+         virtual ~CObject(void);
+
+         /// Accesseurs ///
+         const StdString & getId(void) const;
+
+         /// Mutateurs ///
+         void resetId(void);
+         void setId(const StdString & id);
+
+         /// Tests ///
+         bool hasId(void) const;
+
+         /// OpÃ©rateurs ///
+         bool operator==(const CObject & other) const;
+         bool operator!=(const CObject & other) const;
+
+         /// Flux ///
+         friend StdOStream & operator << (StdOStream & os, const CObject & object);
+
+         /// Autres ///
+         virtual StdString toString(void) const = 0;
+         virtual void fromString(const StdString & str) = 0;
+
+      protected :
+
+         /// Constructeurs ///
+         CObject(void);
+         explicit CObject(const StdString & id);
+         CObject(const CObject & object);
+         CObject(const CObject * const object); // Not implemented.
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         StdString id ;    // identifiant de l'Object
+         bool IdDefined ;  // true si l'object est identifiÃ©, false sinon.
+
+   }; // class CObject
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObject__
+
Index: /XIOS/trunk/src/object_factory.cpp
===================================================================
--- /XIOS/trunk/src/object_factory.cpp	(revision 306)
+++ /XIOS/trunk/src/object_factory.cpp	(revision 306)
@@ -0,0 +1,15 @@
+#include "object_factory.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   StdString CObjectFactory::CurrContext("");
+
+   void CObjectFactory::SetCurrentContextId(const StdString & context)
+   { CObjectFactory::CurrContext = context; }
+
+   StdString & CObjectFactory::GetCurrentContextId(void)
+   { return (CObjectFactory::CurrContext); }
+
+} // namespace xmlioserver
Index: /XIOS/trunk/src/object_factory.hpp
===================================================================
--- /XIOS/trunk/src/object_factory.hpp	(revision 306)
+++ /XIOS/trunk/src/object_factory.hpp	(revision 306)
@@ -0,0 +1,66 @@
+#ifndef __XMLIO_CObjectFactory__
+#define __XMLIO_CObjectFactory__
+
+/// boost headers ///
+#include <boost/shared_ptr.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "object_template.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CObjectFactory
+   {
+      public :
+
+         /// Mutateurs ///
+         static void SetCurrentContextId(const StdString & context);
+
+         /// Accesseurs ///
+         static StdString & GetCurrentContextId(void);
+
+         template <typename U>
+            static inline boost::shared_ptr<U> GetObject(const StdString & id);
+
+         template <typename U>
+            static inline boost::shared_ptr<U> GetObject(const StdString& context,const StdString & id);
+
+         template <typename U>
+            static inline boost::shared_ptr<U> GetObject(const U * const object);
+
+         template <typename U>
+            static inline int GetObjectNum(void);
+         template <typename U>
+            static inline int GetObjectIdNum(void);
+
+         template <typename U>
+            static inline const std::vector<boost::shared_ptr<U> > &
+               GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId());
+
+         /// Tests ///
+         template <typename U>
+            static inline bool HasObject(const StdString & id);
+
+         template <typename U>
+            static inline bool HasObject(const StdString& context,const StdString & id);
+
+         /// Instanciateur ///
+         template <typename U>
+            static inline boost::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
+
+         template <typename U> static inline StdString GenUId(void) ; 
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static StdString CurrContext;
+
+   }; // class CObjectFactory
+} // namespace xmlioserver
+
+#include "object_factory_impl.hpp"
+
+#endif // __XMLIO_CObjectFactory__
Index: /XIOS/trunk/src/object_factory_impl.hpp
===================================================================
--- /XIOS/trunk/src/object_factory_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/object_factory_impl.hpp	(revision 306)
@@ -0,0 +1,152 @@
+#ifndef __XMLIO_CObjectFactory_impl__
+#define __XMLIO_CObjectFactory_impl__
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <typename U>
+       int CObjectFactory::GetObjectNum(void)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObjectNum(void)",
+               << "please define current context id !");
+      return (U::AllVectObj[CObjectFactory::CurrContext].size());
+   }
+
+   template <typename U>
+      int CObjectFactory::GetObjectIdNum(void)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObjectIdNum(void)",
+               << "please define current context id !");
+      return (U::AllMapObj[CObjectFactory::CurrContext].size());
+   }
+
+   template <typename U>
+      bool CObjectFactory::HasObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::HasObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      return (U::AllMapObj[CObjectFactory::CurrContext].find(id) !=
+              U::AllMapObj[CObjectFactory::CurrContext].end());
+   }
+
+   template <typename U>
+      bool CObjectFactory::HasObject(const StdString & context, const StdString & id)
+   {
+      if (U::AllMapObj.find(context) == U::AllMapObj.end()) return false ;
+      else return (U::AllMapObj[context].find(id) !=  U::AllMapObj[context].end());
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::GetObject(const U * const object)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObject(const U * const object)",
+               << "please define current context id !");
+      std::vector<boost::shared_ptr<U> > & vect =
+                     U::AllVectObj[CObjectFactory::CurrContext];
+                     
+      typename std::vector<boost::shared_ptr<U> >::const_iterator 
+         it = vect.begin(), end = vect.end();
+      
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<U> ptr = *it;
+         if (ptr.get() == object)
+            return (ptr);
+      }
+      
+      ERROR("CObjectFactory::GetObject(const U * const object)",
+               << "[type = " << U::GetName() << ", "
+               << "adress = " << object << "]"
+               << " object was not found !");
+      return (boost::shared_ptr<U>()); // jamais atteint
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::GetObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      if (!CObjectFactory::HasObject<U>(id))
+         ERROR("CObjectFactory::GetObject(const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " object is not referenced !");
+      return (U::AllMapObj[CObjectFactory::CurrContext][id]);
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::GetObject(const StdString & context, const StdString & id)
+   {
+      if (!CObjectFactory::HasObject<U>(context,id))
+         ERROR("CObjectFactory::GetObject(const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() <<", context = "<<context<< " ] "
+               << " object is not referenced !");
+      return (U::AllMapObj[context][id]);
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::CreateObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::CreateObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<U> value(new U(CObjectFactory::GenUId<U>()));
+         U::AllVectObj[CObjectFactory::CurrContext].insert
+            (U::AllVectObj[CObjectFactory::CurrContext].end(), value);
+         U::AllMapObj[CObjectFactory::CurrContext].insert(std::make_pair(value->getId(), value));
+         return (value);
+      }
+      else if (CObjectFactory::HasObject<U>(id))
+      {
+         return (CObjectFactory::GetObject<U>(id));
+      }
+      else
+      {
+         boost::shared_ptr<U> value(new U(id));
+         U::AllVectObj[CObjectFactory::CurrContext].insert
+            (U::AllVectObj[CObjectFactory::CurrContext].end(), value);
+         U::AllMapObj[CObjectFactory::CurrContext].insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      const std::vector<boost::shared_ptr<U> > &
+         CObjectFactory::GetObjectVector(const StdString & context)
+   {
+      return (U::AllVectObj[context]);
+   }
+   
+   template <typename U> 
+       StdString CObjectFactory::GenUId(void)
+       {
+          long int seed ;
+          
+          xios_map<StdString,long int>::iterator it ;
+          it=U::GenId.find(CObjectFactory::CurrContext);
+          if (it==U::GenId.end())
+          {
+            seed=0 ;
+            U::GenId[CObjectFactory::CurrContext]=seed ;
+          }
+          else
+          {
+            seed=it->second ;
+            seed++ ;
+            it->second=seed ;
+          }
+          
+          StdOStringStream oss ;
+          oss<<"__"<<U::GetName()<<"_undef_id_"<<seed ;
+          return StdString(oss.str()) ;
+        }
+          
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObjectFactory_impl__
Index: /XIOS/trunk/src/object_template.hpp
===================================================================
--- /XIOS/trunk/src/object_template.hpp	(revision 306)
+++ /XIOS/trunk/src/object_template.hpp	(revision 306)
@@ -0,0 +1,98 @@
+#ifndef __XMLIO_CObjectTemplate__
+#define __XMLIO_CObjectTemplate__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "attribute_map.hpp"
+#include "node_enum.hpp"
+#include "buffer_in.hpp"
+#include "event_server.hpp"
+#include "attribute.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <class T>
+      class CObjectTemplate
+         : public CObject
+         , public virtual tree::CAttributeMap
+   {
+
+         /// Friend ///
+         friend class CObjectFactory;
+
+         /// Typedef ///
+         typedef tree::CAttributeMap SuperClassMap;
+         typedef CObject SuperClass;
+         typedef T DerivedType;
+         
+         enum EEventId
+         {
+           EVENT_ID_SEND_ATTRIBUTE=100
+         } ;
+
+      public :
+
+         /// Autres ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+
+         virtual void toBinary  (StdOStream & os) const;
+         virtual void fromBinary(StdIStream & is);
+
+         virtual void parse(xml::CXMLNode & node);
+         
+         /// Accesseurs ///
+         tree::ENodeType getType(void) const;
+
+         /// Test ///
+         virtual bool hasChild(void) const;
+
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+
+         /// Traitement statique ///
+         static void ClearAllAttributes(void);
+         void sendAttributToServer(const string& id);
+         void sendAttributToServer(tree::CAttribute& attr) ;
+         static void recvAttributFromClient(CEventServer& event) ;
+         static bool dispatchEvent(CEventServer& event) ;
+
+         /// Accesseur statique ///
+         static std::vector<boost::shared_ptr<DerivedType> > &
+            GetAllVectobject(const StdString & contextId);
+
+         /// Destructeur ///
+         virtual ~CObjectTemplate(void);
+         
+         static bool has(const string& id) ;
+         static boost::shared_ptr<T> get(const string& id) ;
+         boost::shared_ptr<T> get(void) ;
+         static boost::shared_ptr<T> create(const string& id=string("")) ;
+         
+      protected :
+
+         /// Constructeurs ///
+         CObjectTemplate(void);
+         explicit CObjectTemplate(const StdString & id);
+         CObjectTemplate(const CObjectTemplate<T> & object,
+                         bool withAttrList = true, bool withId = true);
+         CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented.
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static xios_map<StdString,
+                xios_map<StdString,
+                boost::shared_ptr<DerivedType> > > AllMapObj; 
+         static xios_map<StdString,
+                std::vector<boost::shared_ptr<DerivedType> > > AllVectObj;
+                
+         static xios_map< StdString, long int > GenId ;
+
+   }; // class CObjectTemplate
+} // namespace xmlioserver
+
+//#include "object_template_impl.hpp"
+
+#endif // __XMLIO_CObjectTemplate__
Index: /XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/object_template_impl.hpp	(revision 306)
+++ /XIOS/trunk/src/object_template_impl.hpp	(revision 306)
@@ -0,0 +1,244 @@
+#ifndef __XMLIO_CObjectTemplate_impl__
+#define __XMLIO_CObjectTemplate_impl__
+
+#include "object_factory.hpp"
+#include "context.hpp"
+#include "transfert_parameters.hpp"
+#include "buffer_in.hpp"
+#include "attribute.hpp"
+#include "event_client.hpp"
+#include "context_client.hpp"
+#include "object_template.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <class T>
+      xios_map<StdString,
+      xios_map<StdString,
+      boost::shared_ptr<T> > > CObjectTemplate<T>::AllMapObj;
+
+   template <class T>
+      xios_map<StdString,
+      std::vector<boost::shared_ptr<T> > > CObjectTemplate<T>::AllVectObj;
+
+   template <class T>
+      xios_map<StdString,long int> CObjectTemplate<T>::GenId;
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate(void)
+         : tree::CAttributeMap()
+         , CObject()
+   { /* Ne rien faire de plus */ }
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate(const StdString & id)
+         : tree::CAttributeMap()
+         , CObject(id)
+   { /* Ne rien faire de plus */ }
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate
+         (const CObjectTemplate<T> & object, bool withAttrList, bool withId)
+         : tree::CAttributeMap()
+         , CObject()
+   {
+      if (object.hasId() && withId)
+         this->setId(object.getId());
+      ERROR("CObjectTemplate<T> construtor 3", << "Not completly implemented yet !");
+   }
+   
+   template <class T>
+      CObjectTemplate<T>::~CObjectTemplate(void)
+   { /* Ne rien faire de plus */ }
+
+   ///--------------------------------------------------------------
+
+   template <class T>
+      std::vector<boost::shared_ptr<T> > &
+         CObjectTemplate<T>::GetAllVectobject(const StdString & contextId)
+   { 
+      return (CObjectTemplate<T>::AllVectObj[contextId]); 
+   }
+   
+   //---------------------------------------------------------------
+   
+   template <class T>
+      StdString CObjectTemplate<T>::toString(void) const
+   {
+      StdOStringStream oss;
+      oss << "<" << T::GetName();
+      if (this->hasId())
+         oss << " id=\"" << this->getId() << "\"";
+      oss << " " << SuperClassMap::toString() << "/>";
+      return (oss.str());
+   }
+
+   template <class T>
+      void CObjectTemplate<T>::fromString(const StdString & str)
+   { 
+      ERROR("CObjectTemplate<T>::fromString(str)",
+            << "[ str = " << str << "] Not implemented yet !"); 
+   }
+   
+   //---------------------------------------------------------------
+   
+   template <class T>
+      void CObjectTemplate<T>::toBinary(StdOStream & os) const
+   {
+      SuperClassMap::toBinary(os);    
+   }
+      
+   template <class T>
+      void CObjectTemplate<T>::fromBinary(StdIStream & is)
+   {
+      SuperClassMap::fromBinary(is); 
+   }
+   
+   //---------------------------------------------------------------
+
+   template <class T>
+      void CObjectTemplate<T>::parse(xml::CXMLNode & node)
+   {
+      xml::THashAttributes attributes = node.getAttributes();
+      CAttributeMap::setAttributes(attributes);
+   }
+
+   //---------------------------------------------------------------
+
+   template <class T>
+      tree::ENodeType CObjectTemplate<T>::getType(void) const
+   {
+      return (T::GetType());
+   }
+   
+   //---------------------------------------------------------------
+
+   template <class T>
+      bool CObjectTemplate<T>::hasChild(void) const
+   { 
+      return (false); 
+   }
+
+   //---------------------------------------------------------------
+
+   template <class T>
+      void CObjectTemplate<T>::solveDescInheritance(const CAttributeMap * const parent)
+   { 
+      SuperClassMap::setAttributes(parent); 
+   }
+
+   //---------------------------------------------------------------
+
+   template <class T>
+      void CObjectTemplate<T>::ClearAllAttributes(void)
+   {
+      std::vector<boost::shared_ptr<T> > & avect =
+         CObjectTemplate<T>::GetAllVectobject(CObjectFactory::GetCurrentContextId());
+      typename std::vector<boost::shared_ptr<T> >::iterator
+            it = avect.begin(), end = avect.end();
+
+      for (;it != end; it++)
+      {
+         CAttributeMap & amap = **it;
+         amap.clearAllAttributes();
+      }
+   }
+
+   template <class T>
+   void CObjectTemplate<T>::sendAttributToServer(const string& id)
+   {
+      CAttributeMap & attrMap = *this;
+      CAttribute* attr=attrMap[id] ;
+      sendAttributToServer(*attr) ;
+   }
+
+   template <class T>
+   void CObjectTemplate<T>::sendAttributToServer(tree::CAttribute& attr)
+   {
+     shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+     
+    if (!context->hasServer)
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<attr.getName() ;
+         msg<<attr ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   template <class T>
+   void CObjectTemplate<T>::recvAttributFromClient(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id,attrId;
+      *buffer>>id ;
+      CAttributeMap & attrMap = *get(id);
+      *buffer>>attrId ;
+      CAttribute* attr=attrMap[attrId] ;
+      info(50)<<"attribut recu "<<attrId<<"  " ;
+      if (attr->isEmpty()) info(50)<<"--> empty"<<endl ;
+      else info(50) /*<attr->getValue()*/<<endl ;
+      *buffer>>*attr ;
+       info(50)<<"attribut recu "<<attrId<<"  " ;
+      if (attr->isEmpty()) info(50)<<"--> empty"<<endl ;
+      else info(50) /*attr->getValue()*/<<endl ;
+  }
+
+   template <class T>
+   bool CObjectTemplate<T>::dispatchEvent(CEventServer& event)
+   {
+      switch(event.type)
+      {
+         case EVENT_ID_SEND_ATTRIBUTE :
+           recvAttributFromClient(event) ;
+           return true ;
+           break ;
+       
+         default :
+         return false ;
+//           ERROR("void CObjectTemplate<T>::recvEvent(CEventServer& event)",
+//                 <<"Unknown Event") ;
+      }
+   }
+   
+   template <typename T>
+   bool CObjectTemplate<T>::has(const string & id)
+   {
+     return CObjectFactory::HasObject<T>(id) ;
+   }
+
+   template <typename T>
+   boost::shared_ptr<T> CObjectTemplate<T>::get(const string & id)
+   {
+     return CObjectFactory::GetObject<T>(id) ;
+   }
+
+   template <typename T>
+   boost::shared_ptr<T> CObjectTemplate<T>::create(const string & id)
+   {
+     return CObjectFactory::CreateObject<T>(id) ;
+   }   ///--------------------------------------------------------------
+
+  template <typename T>
+  boost::shared_ptr<T> CObjectTemplate<T>::get(void)
+  {
+    return CObjectFactory::GetObject<T>((T*)this) ;
+  }
+  
+
+  
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObjectTemplate_impl__
Index: /XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 306)
+++ /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 306)
@@ -0,0 +1,657 @@
+
+#include "nc4_data_output.hpp"
+
+#include <boost/lexical_cast.hpp>
+#include "attribute_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "file.hpp"
+#include "calendar.hpp"
+#include "xios_manager.hpp"
+#include "context.hpp"
+#include "context_server.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CNc4DataOutput::CNc4DataOutput
+         (const StdString & filename, bool exist)
+            : SuperClass()
+            , SuperClassWriter(filename, exist)
+            , filename(filename)
+      {
+         StdString timeid = StdString("time_counter");
+         SuperClass::type = MULTI_FILE;
+         if (!exist)
+            SuperClassWriter::addDimension(timeid);
+      }
+
+      CNc4DataOutput::CNc4DataOutput
+         (const StdString & filename, bool exist, MPI_Comm comm_server,bool multifile)
+            : SuperClass()
+            , SuperClassWriter(filename, exist, &comm_server,multifile)
+            , comm_server(comm_server)
+            , filename(filename)
+      {
+         StdString timeid = StdString("time_counter");
+
+         SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
+         
+         if (!exist)
+            SuperClassWriter::addDimension(timeid);
+      }
+
+
+      CNc4DataOutput::~CNc4DataOutput(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      const StdString & CNc4DataOutput::getFileName(void) const
+      {
+         return (this->filename);
+      }
+
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput::writeDomain_(const boost::shared_ptr<tree::CDomain> domain)
+      {
+         shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+         CContextServer* server=context->server ;
+         
+         if (domain->IsWritten(this->filename)) return;
+         domain->checkAttributes();
+         
+         if (domain->isEmpty()) 
+           if (SuperClass::type==MULTI_FILE) return ;
+
+         std::vector<StdString> dim0, dim1;
+         StdString domid     = (!domain->name.isEmpty())
+                             ? domain->name.getValue() : domain->getId();
+         StdString lonid     = StdString("lon_").append(domid);
+         StdString latid     = StdString("lat_").append(domid);
+         StdString lonid_loc = (server->intraCommSize > 1)
+                             ? StdString("lon_").append(domid).append("_local")
+                             : lonid;
+         StdString latid_loc = (server->intraCommSize > 1)
+                             ? StdString("lat_").append(domid).append("_local")
+                             : latid;
+// supress mask         StdString maskid    = StdString("mask_").append(domid).append("_local");
+
+// supress mask         ARRAY(int, 2) mask = domain->getLocalMask();
+
+//         unsigned int ssize = domain->zoom_ni_loc.getValue() * domain->zoom_nj_loc.getValue();
+//         bool isCurvilinear = (domain->lonvalue.getValue()->size() == ssize);
+         bool isCurvilinear = true ; //for moment
+
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+//               if (domain->isEmpty()) return;
+               
+               if (server->intraCommSize > 1)
+               {
+                 SuperClassWriter::addDimension(lonid, domain->zoom_ni.getValue());
+                 SuperClassWriter::addDimension(latid, domain->zoom_nj.getValue());
+               }
+
+               if (isCurvilinear)
+               {
+                 dim0.push_back(latid_loc); dim0.push_back(lonid_loc);
+                 lonid = StdString("nav_lon_").append(domid);
+                 latid = StdString("nav_lat_").append(domid);
+               }
+               else
+               {
+                 dim0.push_back(latid_loc);
+                 dim1.push_back(lonid_loc);
+               }
+
+               SuperClassWriter::addDimension(lonid_loc, domain->zoom_ni_srv);
+               SuperClassWriter::addDimension(latid_loc, domain->zoom_nj_srv);
+               if (server->intraCommSize > 1)
+               {
+                  this->writeLocalAttributes(domain->zoom_ibegin_srv,
+                                             domain->zoom_ni_srv,
+                                             domain->zoom_jbegin_srv,
+                                             domain->zoom_nj_srv,
+                                             domid);
+               }
+               
+               if (isCurvilinear)
+               {
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               }
+               else
+               {
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+               }
+               this->writeAxisAttributes
+                  (lonid, "X", "longitude", "Longitude", "degrees_east", domid);
+               this->writeAxisAttributes
+                  (latid, "Y", "latitude", "Latitude", "degrees_north", domid);
+
+               dim0.clear();
+               dim0.push_back(latid_loc);
+               dim0.push_back(lonid_loc);
+
+
+// supress mask               if (server->intraCommSize > 1)
+// supress mask               {
+// supress mask                  SuperClassWriter::addVariable(maskid, NC_INT, dim0);
+// supress mask
+// supress mask                  this->writeMaskAttributes(maskid,
+// supress mask                     domain->data_dim.getValue()/*,
+// supress mask                     domain->data_ni.getValue(),
+// supress mask                     domain->data_nj.getValue(),
+// supress mask                     domain->data_ibegin.getValue(),
+// supress mask                     domain->data_jbegin.getValue()*/);
+// supress mask               }
+                  
+               //SuperClassWriter::setDefaultValue(maskid, &dvm);
+
+               SuperClassWriter::definition_end();
+               SuperClassWriter::writeData(domain->latvalue_srv, latid, true, 0);
+               SuperClassWriter::writeData(domain->lonvalue_srv, lonid, true, 0);
+// supress mask               if (server->intraCommSize > 1) SuperClassWriter::writeData(mask, maskid);
+               SuperClassWriter::definition_start();
+
+               break;
+            }
+            case (ONE_FILE) :
+            {
+               SuperClassWriter::addDimension(lonid, domain->zoom_ni.getValue());
+               SuperClassWriter::addDimension(latid, domain->zoom_nj.getValue());
+
+               
+               if (isCurvilinear)
+               {
+                  dim0.push_back(latid); dim0.push_back(lonid);
+                  lonid = StdString("nav_lon_").append(domid);
+                  latid = StdString("nav_lat_").append(domid);
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               }
+               else
+               {
+                  dim0.push_back(latid);
+                  dim1.push_back(lonid);
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+               }
+               this->writeAxisAttributes
+                  (latid, "X", "longitude", "Longitude", "degrees_east", domid);
+               this->writeAxisAttributes
+                  (lonid, "Y", "latitude", "Latitude", "degrees_north", domid);
+
+
+               SuperClassWriter::definition_end();
+               std::vector<StdSize> start(2) ; 
+               std::vector<StdSize> count(2) ;
+               if (domain->isEmpty())
+               {
+                 start[0]=0 ; start [1]=0 ; 
+                 count[0]=0 ; count[1]=0 ; 
+               }
+               else
+               {
+                 start[1]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; start [0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
+                 count[1]=domain->zoom_ni_srv ; count[0]=domain->zoom_nj_srv ; 
+               }
+               
+               SuperClassWriter::writeData(domain->latvalue_srv, latid, true, 0,&start,&count);
+               SuperClassWriter::writeData(domain->lonvalue_srv, lonid, true, 0,&start,&count);
+               SuperClassWriter::definition_start();
+
+               break;
+            }           
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+         domain->addRelFile(this->filename);
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeAxis_(const boost::shared_ptr<tree::CAxis> axis)
+      {
+         if (axis->IsWritten(this->filename)) return;
+         axis->checkAttributes();
+         std::vector<StdString> dims;
+         StdString axisid = (!axis->name.isEmpty())
+                           ? axis->name.getValue() : axis->getId();
+         SuperClassWriter::addDimension(axisid, axis->size.getValue());
+         dims.push_back(axisid);
+         
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE ) :
+            {}
+            case (ONE_FILE) :
+            {
+               SuperClassWriter::addVariable(axisid, NC_FLOAT, dims);
+
+               SuperClassWriter::addAttribute("axis", StdString("Z"), &axisid);
+
+               if (!axis->standard_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("standard_name",  axis->standard_name.getValue(), &axisid);
+
+               if (!axis->long_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("long_name", axis->long_name.getValue(), &axisid);
+
+               if (!axis->unit.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("units", axis->unit.getValue(), &axisid);
+
+               SuperClassWriter::definition_end();
+               SuperClassWriter::writeData(axis->zvalue.getValue(), axisid, true, 0);
+               SuperClassWriter::definition_start();
+
+               break;
+            }
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+         axis->addRelFile(this->filename);
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeField_(const boost::shared_ptr<tree::CField> field)
+      {
+         shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+         CContextServer* server=context->server ;
+
+         std::vector<StdString> dims, coodinates;
+         boost::shared_ptr<CGrid> grid = field->grid;
+         boost::shared_ptr<CDomain> domain = grid->domain;
+           
+         if (domain->isEmpty()) 
+           if (SuperClass::type==MULTI_FILE) return ;
+
+         StdString timeid    = StdString("time_counter");
+         StdString domid     = (!domain->name.isEmpty())
+                             ? domain->name.getValue() : domain->getId();
+         StdString lonid     = StdString("lon_").append(domid);
+         StdString latid     = StdString("lat_").append(domid);
+         StdString lonid_loc = (server->intraCommSize > 1)
+                             ? StdString("lon_").append(domid).append("_local")
+                             : lonid;
+         StdString latid_loc = (server->intraCommSize > 1)
+                             ? StdString("lat_").append(domid).append("_local")
+                             : latid;
+         StdString fieldid   = (!field->name.isEmpty())
+                             ? field->name.getValue() : field->getBaseFieldReference()->getId();
+
+//         unsigned int ssize = domain->zoom_ni_loc.getValue() * domain->zoom_nj_loc.getValue();
+//         bool isCurvilinear = (domain->lonvalue.getValue()->size() == ssize);
+          bool isCurvilinear = true ; // for moment 
+          
+         nc_type type = (!field->prec.isEmpty() &&
+                        ( field->prec.getValue() == 4))
+                        ? NC_FLOAT : NC_DOUBLE;
+         bool wtime   = !(!field->operation.isEmpty() &&
+                         ( field->operation.getValue().compare("once") == 0));
+                         
+         if (wtime)
+         {
+            StdOStringStream oss;
+            oss << "time_" << field->operation.getValue()
+                << "_" << field->getRelFile()->output_freq.getValue();
+
+            coodinates.push_back(oss.str());
+            dims.push_back(timeid);
+         }
+
+         if (!grid->axis_ref.isEmpty())
+         {
+            boost::shared_ptr<CAxis> axis = grid->axis ;
+            StdString axisid = (!axis->name.isEmpty()) ? axis->name.getValue() : axis->getId();
+            dims.push_back(axisid);
+            coodinates.push_back(axisid);
+         }
+
+         if (isCurvilinear)
+         {
+            coodinates.push_back(StdString("nav_lat_").append(domid));
+            coodinates.push_back(StdString("nav_lon_").append(domid));
+         }
+         else
+         {
+            coodinates.push_back(latid);
+            coodinates.push_back(lonid);
+         }
+
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+               dims.push_back(latid_loc);
+               dims.push_back(lonid_loc);
+               break ;
+            }
+            case (ONE_FILE) :
+            {
+               dims.push_back(latid);
+               dims.push_back(lonid);
+               break;
+            }
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+          
+         SuperClassWriter::addVariable(fieldid, type, dims);
+         
+         if (!field->standard_name.isEmpty())
+            SuperClassWriter::addAttribute
+               ("standard_name",  field->standard_name.getValue(), &fieldid);
+
+         if (!field->long_name.isEmpty())
+            SuperClassWriter::addAttribute
+               ("long_name", field->long_name.getValue(), &fieldid);
+
+         if (!field->unit.isEmpty())
+            SuperClassWriter::addAttribute
+               ("units", field->unit.getValue(), &fieldid);
+               
+         SuperClassWriter::addAttribute
+               ("online_operation", field->operation.getValue(), &fieldid);
+               
+         if (wtime)
+         {
+            SuperClassWriter::addAttribute
+                  ("interval_operation", field->freq_op.getValue(), &fieldid);
+            SuperClassWriter::addAttribute
+                  ("interval_write", field->getRelFile()->output_freq.getValue(), &fieldid);
+         }
+         
+         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);
+         }
+         else
+         {
+            double * default_value = NULL;
+            SuperClassWriter::setDefaultValue(fieldid, default_value);
+         }             
+
+         {  // Ecriture des coordonnÃ©es
+         
+            StdString coordstr; //boost::algorithm::join(coodinates, " ")
+            std::vector<StdString>::iterator 
+               itc = coodinates.begin(), endc = coodinates.end();
+            
+            for (; itc!= endc; itc++)
+            {
+               StdString & coord = *itc;
+               if (itc+1 != endc)
+                     coordstr.append(coord).append(" ");
+               else  coordstr.append(coord);
+            }
+
+            SuperClassWriter::addAttribute("coordinates", coordstr, &fieldid);
+
+         }
+
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeFile_ (const boost::shared_ptr<tree::CFile> file)
+      {
+         StdString filename = (!file->name.isEmpty())
+                            ? file->name.getValue() : file->getId();
+         StdString description = (!file->description.isEmpty())
+                               ? file->description.getValue()
+                               : StdString("Created by xmlioserver");
+         this->writeFileAttributes(filename, description,
+                                   StdString ("CF-1.1"),
+                                   StdString("An IPSL model"),
+                                   this->getTimeStamp());
+      }
+
+      void CNc4DataOutput::closeFile_ (void)
+      {
+         SuperClassWriter::close() ;
+      }
+
+      //---------------------------------------------------------------
+
+      StdString CNc4DataOutput::getTimeStamp(void) const
+      {
+         const int buffer_size = 100;
+         time_t rawtime;
+         struct tm * timeinfo = NULL;
+         char buffer [buffer_size];
+
+         time ( &rawtime );
+         timeinfo = localtime ( &rawtime );
+         strftime (buffer, buffer_size, "%Y-%b-%d %H:%M:%S %Z", timeinfo);
+
+         return (StdString(buffer));
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CNc4DataOutput::writeFieldData_ (const boost::shared_ptr<tree::CField>  field)
+      {
+         shared_ptr<CContext> context=CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()) ;
+
+         boost::shared_ptr<CGrid> grid = field->grid ;
+         boost::shared_ptr<CDomain> domain = grid->domain ;
+         
+         if(SuperClass::type==MULTI_FILE) if (domain->isEmpty()) return;
+
+
+         StdString fieldid   = (!field->name.isEmpty()) 
+                             ? field->name.getValue() 
+                             : field->getBaseFieldReference()->getId();
+                             
+         StdOStringStream oss;
+         oss << "time_" << field->operation.getValue()
+             << "_" << field->getRelFile()->output_freq.getValue();
+             
+ //        ARRAY(double, 1) field_data = field->data_srv;
+         ARRAY_CREATE(time_data, double, 1, [1]);
+         (*time_data)[0] = date::Time(*field->last_Write_srv);
+         
+         if (grid->hasAxis()) // 3D
+         {
+            boost::shared_ptr<CAxis> axis = grid->axis ;
+            ARRAY_CREATE(field_data3D,double,3,[domain->zoom_ni_srv][domain->zoom_nj_srv][axis->size.getValue()]) ;
+            field->outputField(field_data3D);
+            switch (SuperClass::type)
+           {
+              case (MULTI_FILE) :
+              {
+                 SuperClassWriter::writeData(field_data3D, fieldid, true, field->getNStep()-1);
+                 SuperClassWriter::writeData(time_data, oss.str(), true, field->getNStep()-1);
+                 break ;
+              }
+              case (ONE_FILE) :
+              {
+                 std::vector<StdSize> start(3) ; 
+                 std::vector<StdSize> count(3) ;
+                 if (domain->isEmpty())
+                 {
+                   start[0]=0 ; start[1]=0 ; start[2]=0 ;
+                   count[0]=0 ; count[1]=0 ; start[2]=0 ;
+                 }
+                 else
+                 {
+//                 start[2]=domain->zoom_ibegin_loc.getValue()-domain->zoom_ibegin.getValue() ; start [1]=domain->zoom_jbegin_loc.getValue()-domain->zoom_jbegin.getValue() ; start[0]=0 ;
+                   start[2]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; start [1]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; start[0]=0 ;
+                   count[2]=domain->zoom_ni_srv ; count[1]=domain->zoom_nj_srv ; count[0] = axis->size.getValue();
+                 }
+                 SuperClassWriter::writeData(field_data3D, fieldid, true, field->getNStep()-1,&start,&count );
+                 SuperClassWriter::writeData(time_data, oss.str(), true, field->getNStep()-1 );
+                 break;
+              }
+            }
+            
+         }
+         else // 2D
+         {
+            ARRAY_CREATE(field_data2D,double,2,[domain->zoom_ni_srv][domain->zoom_nj_srv]) ;
+            field->outputField(field_data2D);
+            switch (SuperClass::type)
+            {
+              case (MULTI_FILE) :
+              {
+                SuperClassWriter::writeData(field_data2D, fieldid, true, field->getNStep()-1);
+                SuperClassWriter::writeData(time_data, oss.str(), true, field->getNStep()-1);
+                break;
+              }
+              case (ONE_FILE) :
+              {
+                 std::vector<StdSize> start(2) ; 
+                 std::vector<StdSize> count(2) ;
+                 if (domain->isEmpty())
+                 {
+                   start[0]=0 ; start[1]=0 ;
+                   count[0]=0 ; count[1]=0 ;
+                 }
+                 else
+                 {
+                   start[1]=domain->zoom_ibegin_srv-domain->zoom_ibegin.getValue() ; start[0]=domain->zoom_jbegin_srv-domain->zoom_jbegin.getValue() ; 
+                   count[1]=domain->zoom_ni_srv ; count[0]=domain->zoom_nj_srv ;
+                 }
+
+                 SuperClassWriter::writeData(field_data2D, fieldid, true, field->getNStep()-1,&start,&count);
+                 SuperClassWriter::writeData(time_data, oss.str(), true, field->getNStep()-1);
+                 break;
+              
+              }
+            }
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput::writeTimeAxis_
+                  (const boost::shared_ptr<tree::CField>    field,
+                   const boost::shared_ptr<date::CCalendar> cal)
+      {
+         StdOStringStream oss;
+         oss << "time_" << field->operation.getValue()
+             << "_" << field->getRelFile()->output_freq.getValue();
+
+         std::vector<StdString> dims;
+         StdString axisid = oss.str();
+         StdString timeid = StdString("time_counter");
+
+         dims.push_back(timeid);
+         if (!SuperClassWriter::varExist(axisid))
+         {
+            SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims);
+            date::CDate initDate=cal->getInitDate() ;
+            StdOStringStream oss2;
+            oss2<<initDate.getYear()<<"-"<<initDate.getMonth()<<"-"<<initDate.getDay()<<" "
+                <<initDate.getHour()<<"-"<<initDate.getMinute()<<"-"<<initDate.getSecond() ;
+            StdString strInitdate=oss2.str() ;
+            this->writeTimeAxisAttributes
+               (axisid, cal->getType(),
+                StdString("seconds since ").append(strInitdate),
+                strInitdate);
+         }
+
+      }
+
+      //---------------------------------------------------------------
+      
+      void CNc4DataOutput::writeTimeAxisAttributes(const StdString & axis_name,
+                                                   const StdString & calendar,
+                                                   const StdString & units,
+                                                   const StdString & time_origin,
+                                                   const StdString & standard_name,
+                                                   const StdString & long_name,
+                                                   const StdString & title)
+      {
+         SuperClassWriter::addAttribute("standard_name", standard_name, &axis_name);
+         SuperClassWriter::addAttribute("long_name",     long_name    , &axis_name);
+         SuperClassWriter::addAttribute("title",         title        , &axis_name);
+         SuperClassWriter::addAttribute("calendar",      calendar     , &axis_name);
+         SuperClassWriter::addAttribute("units",         units        , &axis_name);
+         SuperClassWriter::addAttribute("time_origin",   time_origin  , &axis_name);
+      }
+      
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput::writeAxisAttributes(const StdString & axis_name,
+                                               const StdString & axis,
+                                               const StdString & standard_name,
+                                               const StdString & long_name,
+                                               const StdString & units,
+                                               const StdString & nav_model)
+      {
+         SuperClassWriter::addAttribute("axis"         , axis         , &axis_name);
+         SuperClassWriter::addAttribute("standard_name", standard_name, &axis_name);
+         SuperClassWriter::addAttribute("long_name"    , long_name    , &axis_name);
+         SuperClassWriter::addAttribute("units"        , units        , &axis_name);
+         SuperClassWriter::addAttribute("nav_model"    , nav_model    , &axis_name);
+      }
+
+      //---------------------------------------------------------------
+      
+      void CNc4DataOutput::writeLocalAttributes
+         (int ibegin, int ni, int jbegin, int nj, StdString domid)
+      {
+         SuperClassWriter::addAttribute(StdString("ibegin_").append(domid), ibegin);
+         SuperClassWriter::addAttribute(StdString("ni_"    ).append(domid), ni);
+         SuperClassWriter::addAttribute(StdString("jbegin_").append(domid), jbegin);
+         SuperClassWriter::addAttribute(StdString("nj_"    ).append(domid), nj);
+      }
+
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput:: writeFileAttributes(const StdString & name,
+                                                const StdString & description,
+                                                const StdString & conventions,
+                                                const StdString & production,
+                                                const StdString & timeStamp)
+      {
+         SuperClassWriter::addAttribute("name"       , name);
+         SuperClassWriter::addAttribute("description", description);
+         SuperClassWriter::addAttribute("conventions", conventions);
+         SuperClassWriter::addAttribute("production" , production);
+         SuperClassWriter::addAttribute("timeStamp"  , timeStamp);
+      }
+
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput::writeMaskAttributes(const StdString & mask_name,
+                                               int data_dim,
+                                               int data_ni,
+                                               int data_nj,
+                                               int data_ibegin,
+                                               int data_jbegin)
+      {
+         SuperClassWriter::addAttribute("data_dim"   , data_dim   , &mask_name);
+         SuperClassWriter::addAttribute("data_ni"    , data_ni    , &mask_name);
+         SuperClassWriter::addAttribute("data_nj"    , data_nj    , &mask_name);
+         SuperClassWriter::addAttribute("data_ibegin", data_ibegin, &mask_name);
+         SuperClassWriter::addAttribute("data_jbegin", data_jbegin, &mask_name);
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 306)
+++ /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 306)
@@ -0,0 +1,104 @@
+#ifndef __XMLIO_NC4_DATA_OUTPUT__
+#define __XMLIO_NC4_DATA_OUTPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "onetcdf4.hpp"
+#include "data_output.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CNc4DataOutput
+         : protected CONetCDF4
+         , public virtual CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef CONetCDF4   SuperClassWriter;
+            typedef CDataOutput SuperClass;
+
+            /// Constructeurs ///
+            CNc4DataOutput
+               (const StdString & filename, bool exist);
+            CNc4DataOutput
+               (const StdString & filename, bool exist, MPI_Comm comm_server, bool multifile);
+
+            CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
+            CNc4DataOutput(const CNc4DataOutput * const dataoutput); // Not implemented.
+
+            /// Accesseur ///
+            const StdString & getFileName(void) const;
+
+            /// Destructeur ///
+            virtual ~CNc4DataOutput(void);
+
+         protected :
+
+            /// Ecriture ///
+            virtual void writeDomain_    (const boost::shared_ptr<tree::CDomain>   domain);
+            virtual void writeAxis_      (const boost::shared_ptr<tree::CAxis>     axis);
+            virtual void writeField_     (const boost::shared_ptr<tree::CField>    field);
+            virtual void writeFieldData_ (const boost::shared_ptr<tree::CField>    field);
+            virtual void writeFile_      (const boost::shared_ptr<tree::CFile>     file);
+            virtual void closeFile_      (void);
+            virtual void writeTimeAxis_  (const boost::shared_ptr<tree::CField>    field,
+                                          const boost::shared_ptr<date::CCalendar> cal);
+
+         protected :
+         
+            void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid);
+
+            void writeTimeAxisAttributes(const StdString & axis_name,
+                                         const StdString & calendar,
+                                         const StdString & units,
+                                         const StdString & time_origin,
+                                         const StdString & standard_name = StdString("time"),
+                                         const StdString & long_name     = StdString("Time axis"),
+                                         const StdString & title         = StdString("Time"));
+
+            void writeFileAttributes(const StdString & name,
+                                     const StdString & description,
+                                     const StdString & conventions,
+                                     const StdString & production,
+                                     const StdString & timeStamp);
+
+            void writeMaskAttributes(const StdString & mask_name,
+                                     int data_dim,
+                                     int data_ni     = 0,
+                                     int data_nj     = 0,
+                                     int data_ibegin = 0,
+                                     int data_jbegin = 0);
+
+            void writeAxisAttributes(const StdString & axis_name,
+                                     const StdString & axis,
+                                     const StdString & standard_name,
+                                     const StdString & long_name,
+                                     const StdString & units,
+                                     const StdString & nav_model);
+            template <class T>
+               void writeAxisData(const StdString & axis_name,
+                                  const ARRAY(T, 1) data,
+                                  bool collective, StdSize record,
+                                  const std::vector<StdSize> * start = NULL,
+                                  const std::vector<StdSize> * count = NULL);
+
+         private :
+
+            /// Traitement ///
+            StdString getTimeStamp(void) const;
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            MPI_Comm comm_server;
+            const StdString filename;
+
+      }; // class CNc4DataOutput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_NC4_DATA_OUTPUT__
Index: /XIOS/trunk/src/output/onetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/output/onetcdf4.cpp	(revision 306)
+++ /XIOS/trunk/src/output/onetcdf4.cpp	(revision 306)
@@ -0,0 +1,412 @@
+#include "onetcdf4.hpp"
+#include "group_template_impl.hpp"
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CONetCDF4::CONetCDF4
+         (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile)
+            : path()
+      {
+         this->wmpi = (comm != NULL) && !multifile;
+         this->initialize(filename, exist, comm,multifile);
+      }
+      
+      //---------------------------------------------------------------
+      
+      
+
+      CONetCDF4::~CONetCDF4(void)
+      {
+//         CheckError(nc_close(this->ncidp));
+      }
+
+      ///--------------------------------------------------------------
+
+      void CONetCDF4::initialize
+         (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile)
+      {
+         if (!exist)
+         {
+            if (comm != NULL)
+            {
+               if (!multifile) CheckError(nc_create_par(filename.c_str(), NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, &this->ncidp));
+               else CheckError(nc_create(filename.c_str(), NC_NETCDF4, &this->ncidp));
+            }
+            else CheckError(nc_create(filename.c_str(), NC_NETCDF4, &this->ncidp));
+         }
+         else
+         {
+            if (comm != NULL)
+            {
+               if (!multifile) CheckError(nc_open_par(filename.c_str(), NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, &this->ncidp));
+               else CheckError(nc_open(filename.c_str(), NC_NETCDF4, &this->ncidp));
+            }
+            else  CheckError(nc_open(filename.c_str(), NC_NETCDF4, &this->ncidp));
+         }
+      }
+      
+      void CONetCDF4::close()
+      {
+        CheckError(nc_close(this->ncidp));
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CONetCDF4::definition_start(void)
+      { 
+         CheckError(nc_redef(this->ncidp));
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CONetCDF4::definition_end(void)
+      { 
+         CheckError(nc_enddef(this->ncidp));
+      }
+      
+      //---------------------------------------------------------------
+      
+      void CONetCDF4::CheckError(int status)
+      {
+         if (status != NC_NOERR)
+         {
+            StdString errormsg (nc_strerror(status)); // fuite mÃ©moire ici ?
+            ERROR("CONetCDF4::CheckError(int status)",
+                  << "[ status = " << status << " ] " << errormsg);
+         }
+      }
+
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::getCurrentGroup(void)
+      {
+         return (this->getGroup(this->getCurrentPath()));
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::getGroup(const CONetCDF4Path & path)
+      {
+         int retvalue = this->ncidp;
+         
+         CONetCDF4Path::const_iterator
+            it  = path.begin(), end = path.end();
+
+         for (;it != end; it++)
+         {
+            const StdString & groupid = *it;
+            CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
+         }
+         return (retvalue);
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::getVariable(const StdString & varname)
+      {
+         int varid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_varid (grpid, varname.c_str(), &varid));
+         return (varid);
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::getDimension(const StdString & dimname)
+      {
+         int dimid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_dimid (grpid, dimname.c_str(), &dimid));
+         return (dimid);
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::getUnlimitedDimension(void)
+      {
+         int dimid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_unlimdim (grpid, &dimid));
+         return (dimid);
+      }
+      
+      StdString CONetCDF4::getUnlimitedDimensionName(void)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int grpid = this->getGroup(path);
+         int dimid = this->getUnlimitedDimension();
+                              
+         if (dimid == -1) return (std::string());
+            CheckError(nc_inq_dimname(grpid, dimid, full_name_in));
+                                          
+         StdString dimname(full_name_in);
+         return (dimname);
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::vector<StdSize> CONetCDF4::getDimensions(const StdString & varname)
+      {
+         StdSize size = 0;
+         std::vector<StdSize> retvalue;
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(varname);
+         int nbdim = 0, *dimid = NULL;
+
+         CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+         dimid = new int[nbdim]();
+         CheckError(nc_inq_vardimid(grpid, varid, dimid));
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimlen (grpid, dimid[i], &size));
+            if (size == NC_UNLIMITED)
+                size = UNLIMITED_DIM;
+            retvalue.push_back(size);
+         }
+
+         return (retvalue);
+      }
+
+      std::vector<std::string> CONetCDF4::getDimensionsIdList (const std::string * _varname)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int nbdim = 0, *dimid = NULL;
+         int grpid = this->getCurrentGroup();
+         int varid = (_varname != NULL) ? this->getVariable(*_varname) : NC_GLOBAL;
+         std::vector<std::string> retvalue;
+                                   
+         if (_varname != NULL)
+         {
+            CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_vardimid(grpid, varid, dimid));
+         }
+         else
+         {
+            CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+         }
+                                        
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
+            std::string dimname(full_name_in);
+            retvalue.push_back(dimname);
+         }
+         delete [] dimid;
+                                                                                                                                                      
+         return (retvalue);
+      }
+
+
+      //---------------------------------------------------------------
+
+      const CONetCDF4::CONetCDF4Path & CONetCDF4::getCurrentPath(void) const
+      { return (this->path); }
+
+      void CONetCDF4::setCurrentPath(const CONetCDF4Path & path)
+      { this->path = path; }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::addGroup(const StdString & name)
+      {
+         int retvalue = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_def_grp(grpid, const_cast<char*>(name.c_str()), &retvalue));
+         return (retvalue);
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::addDimension(const StdString& name, const StdSize size)
+      {
+         int retvalue = 0;
+         int grpid = this->getCurrentGroup();
+         if (size != UNLIMITED_DIM)
+            CheckError(nc_def_dim (grpid, name.c_str(), size, &retvalue));
+         else
+            CheckError(nc_def_dim (grpid, name.c_str(), NC_UNLIMITED, &retvalue));
+         return (retvalue);
+      }
+      
+      //---------------------------------------------------------------
+      
+      int CONetCDF4::addVariable(const StdString & name, nc_type type,
+                                  const std::vector<StdString> & dim)
+      {
+         int retvalue = 0;
+         std::vector<int> dimids;
+         int grpid = this->getCurrentGroup();
+         
+         std::vector<StdString>::const_iterator
+            it  = dim.begin(), end = dim.end();
+
+         for (;it != end; it++)
+         {
+            const StdString & dimid = *it;
+            dimids.push_back(this->getDimension(dimid));
+         }
+         CheckError(nc_def_var (grpid, name.c_str(), type, dimids.size(), &(dimids[0]), &retvalue));
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const StdString & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att(grpid, varid, name.c_str(), NC_CHAR, value.size()+1, value.c_str()));
+         //CheckError(nc_put_att_string(grpid, varid, name.c_str(), 1, &str));
+      }
+      
+      //---------------------------------------------------------------
+      
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const double & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_double(grpid, varid, name.c_str(), NC_DOUBLE,1, &value));
+      }
+      
+      //---------------------------------------------------------------
+      
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const float & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_float(grpid, varid, name.c_str(), NC_FLOAT, 1, &value));
+      }
+      
+      //---------------------------------------------------------------
+      
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const int & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_int(grpid, varid, name.c_str(), NC_INT,1, &value));
+      }
+
+      //---------------------------------------------------------------
+
+      void CONetCDF4::getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
+                                        std::vector<StdSize> & sstart,
+                                        std::vector<StdSize> & scount,
+                                        const std::vector<StdSize> * start,
+                                        const std::vector<StdSize> * count)
+      {   
+         std::vector<std::size_t> sizes  = this->getDimensions(name);
+         std::vector<std::string> iddims = this->getDimensionsIdList (&name);   
+         std::vector<std::size_t>::const_iterator
+            it  = sizes.begin(), end = sizes.end();
+         int i = 0;
+      
+         if (iddims.begin()->compare(this->getUnlimitedDimensionName()) == 0)
+         {
+            sstart.push_back(record);
+            scount.push_back(1); 
+            if ((start == NULL) &&
+                (count == NULL)) i++;
+            it++;
+         }
+
+         for (;it != end; it++)
+         {      
+            if ((start != NULL) && (count != NULL))
+            {
+               sstart.push_back((*start)[i]);
+               scount.push_back((*count)[i]);
+               array_size *= (*count)[i];
+               i++;
+            }
+            else
+            {
+               sstart.push_back(0);
+               scount.push_back(sizes[i]);
+               array_size *= sizes[i];
+               i++;
+            }
+         }
+         
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+         void CONetCDF4::writeData_(int grpid, int varid,
+                                    const std::vector<StdSize> & sstart,
+                                    const std::vector<StdSize> & scount, double * data)
+      {
+         CheckError(nc_put_vara_double(grpid, varid, &(sstart[0]), &(scount[0]), data));
+//         sync() ;
+      }
+      
+      //---------------------------------------------------------------
+      
+      template <>
+         void CONetCDF4::writeData_(int grpid, int varid,
+                                    const std::vector<StdSize> & sstart,
+                                    const std::vector<StdSize> & scount, int * data)
+      {
+          CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data));
+//          sync() ;
+      }
+      
+      //---------------------------------------------------------------
+      
+      template <>
+         void CONetCDF4::writeData_(int grpid, int varid,
+                                    const std::vector<StdSize> & sstart,
+                                    const std::vector<StdSize> & scount, float * data)
+      {
+          CheckError(nc_put_vara_float(grpid, varid, &(sstart[0]), &(scount[0]), data));
+//          sync() ;
+      }
+
+      //---------------------------------------------------------------
+
+      void CONetCDF4::writeData(const ARRAY(int, 2) data, const StdString & name)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL);
+         this->writeData_(grpid, varid, sstart, scount, data->data());
+      }
+
+      //---------------------------------------------------------------
+      
+      bool CONetCDF4::varExist(const StdString & varname)
+      {
+         int varid = 0;
+         int grpid = this->getCurrentGroup();
+         return (nc_inq_varid (grpid, varname.c_str(), &varid) == NC_NOERR);
+      }
+
+      void CONetCDF4::sync(void)
+      {
+        
+         comm::CMPIManager::Barrier(comm::CMPIManager::GetCommServer());
+         CheckError(nc_sync(this->ncidp)) ;
+      } 
+      ///--------------------------------------------------------------
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/output/onetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/output/onetcdf4.hpp	(revision 306)
+++ /XIOS/trunk/src/output/onetcdf4.hpp	(revision 306)
@@ -0,0 +1,182 @@
+#ifndef __XMLIO_INETCDF4__
+#define __XMLIO_INETCDF4__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+#include "data_output.hpp"
+#include "mpi_manager.hpp"
+
+#include <mpi.h>
+#define MPI_INCLUDED
+#include <netcdf.h>
+extern "C" {
+#include <netcdf_par.h>
+}
+
+
+#ifndef UNLIMITED_DIM
+   #define UNLIMITED_DIM (size_t)(-1)
+#endif  //UNLIMITED_DIM
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CONetCDF4
+         : public virtual CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef std::vector<StdString> CONetCDF4Path;
+
+            /// Constructeurs ///
+            CONetCDF4(const StdString & filename, bool exist, const MPI_Comm * comm = NULL, bool multifile=true);
+
+            CONetCDF4(const CONetCDF4 & onetcdf4);       // Not implemented.
+            CONetCDF4(const CONetCDF4 * const onetcdf4); // Not implemented.
+
+
+            /// Initialisation ///
+            void initialize(const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile);
+            void close(void) ;
+            void sync(void) ;
+            void definition_start(void);
+            void definition_end(void);
+
+            /// Mutateurs ///
+            void setCurrentPath(const CONetCDF4Path & path);
+
+            int addGroup(const StdString & name);
+            int addDimension(const StdString& name, const StdSize size = UNLIMITED_DIM);
+            int addVariable(const StdString & name, nc_type type,
+                            const std::vector<StdString> & dim);
+                            
+      //----------------------------------------------------------------
+         public :
+         
+            template <class T>
+               void setDefaultValue(const StdString & varname, const T * value = NULL);
+         
+            template <class T>
+               void addAttribute
+                  (const StdString & name, const T & value, const StdString * varname = NULL);
+
+            /// Ecriture des donnÃ©es ///
+            template <class T, StdSize ndim>
+               void writeData(const ARRAY(T, ndim) data, const StdString & name,
+                              bool collective, StdSize record,
+                              const std::vector<StdSize> * start = NULL,
+                              const std::vector<StdSize> * count = NULL);
+
+            void writeData(const ARRAY(int, 2) data, const StdString & name);
+
+            /// Accesseur ///
+            const CONetCDF4Path & getCurrentPath(void) const;
+
+            /// Destructeur ///
+            virtual ~CONetCDF4(void);
+            
+      //----------------------------------------------------------------
+      
+         protected :
+
+            /// Ecriture ///
+            virtual void writeField_ (const boost::shared_ptr<tree::CField>  field)  = 0;
+            virtual void writeDomain_(const boost::shared_ptr<tree::CDomain> domain) = 0;
+            virtual void writeAxis_  (const boost::shared_ptr<tree::CAxis>   axis)   = 0;
+
+            /// Accesseurs ///
+            int getCurrentGroup(void);
+            int getGroup(const CONetCDF4Path & path);
+            int getVariable(const StdString & varname);
+            int getDimension(const StdString & dimname);
+            std::vector<StdSize>   getDimensions       (const StdString & varname);
+            std::vector<StdString> getDimensionsIdList (const StdString * varname);
+            int       getUnlimitedDimension(void);
+            StdString getUnlimitedDimensionName(void);
+
+            bool varExist(const StdString & varname);
+
+      //----------------------------------------------------------------
+      
+         private :
+         
+            template <class T>
+               void writeData_(int grpid, int varid,
+                               const std::vector<StdSize> & sstart,
+                               const std::vector<StdSize> & scount, T * data);
+
+            void getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
+                                   std::vector<StdSize> & sstart,
+                                   std::vector<StdSize> & scount,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count);
+
+            /// VÃ©rification des erreurs NetCDF ///
+            void CheckError(int status);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            CONetCDF4Path path;
+            int ncidp;
+            bool wmpi;
+
+      }; // class CONetCDF4
+
+      ///---------------------------------------------------------------
+           
+      template <class T, StdSize ndim>
+         void CONetCDF4::writeData(const ARRAY(T, ndim) data, const StdString & name,
+                                   bool collective, StdSize record,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         if (this->wmpi && collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE));
+         if (this->wmpi && !collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT));
+
+         this->getWriteDataInfos
+         (name, record, array_size,  sstart, scount, start, count);
+         if (data->num_elements() != array_size)
+         {
+            ERROR("CONetCDF4::writeData(...)",
+                  << "[ input array size = "  << data->num_elements()
+                  << ", intern array size = " << array_size
+                  << " ] Invalid input data !" );
+         }
+         
+         this->writeData_(grpid, varid, sstart, scount, data->data());
+      }
+      
+      //----------------------------------------------------------------
+           
+      template <class T>
+         void CONetCDF4::setDefaultValue(const StdString & varname, const T * value)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(varname);
+         
+         if (value != NULL)
+         {
+            CheckError(nc_def_var_fill(grpid, varid, 0, value));
+            this->addAttribute(StdString("missing_value"), *value, &varname);
+         }
+         else
+            CheckError(nc_def_var_fill(grpid, varid, 1, NULL));         
+      }
+     
+      ///---------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_INETCDF4__
Index: /XIOS/trunk/src/rebuild.cpp
===================================================================
--- /XIOS/trunk/src/rebuild.cpp	(revision 306)
+++ /XIOS/trunk/src/rebuild.cpp	(revision 306)
@@ -0,0 +1,17 @@
+#include "rebuild.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CRebuild::CRebuild(const StdString & filename)
+      { /* Ne rien faire de plus */ }
+
+      CRebuild::~CRebuild(void)
+      { /* Ne rien faire de plus */ }
+
+
+   } // namespace io
+} // namespace xmlioserver
Index: /XIOS/trunk/src/rebuild.hpp
===================================================================
--- /XIOS/trunk/src/rebuild.hpp	(revision 306)
+++ /XIOS/trunk/src/rebuild.hpp	(revision 306)
@@ -0,0 +1,30 @@
+#ifndef __XMLIO_CRebuild__
+#define __XMLIO_CRebuild__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CRebuild
+      {
+         public :
+
+            /// Construteurs ///
+            CRebuild(void);                            // Never implemented.
+            explicit CRebuild(const StdString & filename);
+            CRebuild(const CRebuild  & rebuild);       // Never implemented.
+            CRebuild(const CRebuild  * const rebuild); // Never implemented.
+
+            /// Destructeur ///
+            virtual ~CRebuild(void);
+
+      }; // class CRebuild
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif // __XMLIO_CRebuild__
Index: /XIOS/trunk/src/server.cpp
===================================================================
--- /XIOS/trunk/src/server.cpp	(revision 306)
+++ /XIOS/trunk/src/server.cpp	(revision 306)
@@ -0,0 +1,285 @@
+#include "xmlioserver_spl.hpp"
+#include "server.hpp"
+
+#include "tree_manager.hpp"
+#include "duration.hpp"
+#include "data_treatment.hpp"
+#include "group_template.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver {
+namespace comm {
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   
+   CServer::CServer(MPI_Comm comm_client_server)
+      : blist(comm_client_server)
+   { /* Ne rien faire de plus */ }  
+        
+   CServer::~CServer(void)
+   { /* Ne rien faire de plus */ } 
+   
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CServer> CServer::Server;
+
+   ///--------------------------------------------------------------
+   
+   const CBufferList & CServer::getBufferList(void) const 
+   {
+      return (this->blist);
+   }
+
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CServer> CServer::CreateServer(MPI_Comm comm_client_server)
+   {
+      if (CServer::Server.get() == NULL)
+         CServer::Server = boost::shared_ptr<CServer>(new CServer(comm_client_server));
+      return (CServer::GetServer());
+   }
+
+   ///--------------------------------------------------------------
+
+   boost::shared_ptr<CServer> CServer::GetServer(void)
+   {
+      return (CServer::Server);
+   }
+   
+   //---------------------------------------------------------------
+   
+   void CServer::run(void)
+   {
+      while (this->blist.recvRequests())
+      {
+         long int managerId = -1, methodId  = -1, nbargs  = -1;
+         long int managerId_= -1, methodId_ = -1, nbargs_ = -1;
+         std::vector<CLinearBuffer> lbuffer;
+         this->blist.getRequests(lbuffer);
+                 
+         for (StdSize i = 0; i < lbuffer.size(); i++)
+         {           
+            lbuffer[i].getRequestInfos(0, managerId, methodId, nbargs);
+            if (((managerId_ != managerId) || (methodId_ != methodId) || (nbargs_ != nbargs)) && (i != 0 ))
+            {
+               ERROR("CServer::run(void)", << "[" << i << "] Les requÃªtes ne sont pas synchronisÃ©es !");
+            }
+            managerId_ = managerId;
+            methodId_  = methodId;
+            nbargs_    = nbargs;
+         }
+            
+         if (managerId == 0)
+         {
+            switch(methodId)
+            {
+               case (0) :
+                  this->initialize();
+                  continue;
+               case (1) :
+                  this->finalize();
+                  return;
+               default  :
+                  ERROR("CServer::run(void)", 
+                     << "[ managerId = " << managerId << ", "
+                     << "[ methodId = "  << methodId  << ", "
+                     << "[ nbargs = "    << nbargs    << "] "
+                     << " Methode inconnue !");
+            }
+         }
+         if (managerId == 1)
+         {
+            switch(methodId)
+            {
+               case (0) :
+                  this->setContext(lbuffer);
+                  continue;
+               case (1) :
+                  this->updateCalendar(lbuffer);
+                  continue;
+               case (2) :
+                  this->setTimestep(lbuffer);
+                  continue;
+               default  :
+                  ERROR("CServer::run(void)", 
+                     << "[ managerId = " << managerId << ", "
+                     << "[ methodId = "  << methodId  << ", "
+                     << "[ nbargs = "    << nbargs    << "] "
+                     << " Methode inconnue !");
+            }
+         }
+         if (managerId == 2)
+         {
+            switch(methodId)
+            {
+               case (0) :
+                  this->writeData(lbuffer, 4);
+                  continue;
+               case (1) :
+                  this->writeData(lbuffer, 8);
+                  continue;
+               default  :
+                  ERROR("CServer::run(void)", 
+                     << "[ managerId = " << managerId << ", "
+                     << "[ methodId = "  << methodId  << ", "
+                     << "[ nbargs = "    << nbargs    << "] "
+                     << " Methode inconnue !");
+            }
+         }
+         ERROR("CServer::run(void)", 
+                << "[ managerId = " << managerId << ", "
+                << "[ methodId = "  << methodId  << ", "
+                << "[ nbargs = "    << nbargs    << "] "
+                << " Methode inconnue !");
+      }
+   }
+
+   //--------------------------------------------------------------
+   
+   void CServer::initialize(void) // manager 0, method 0
+   {
+   }
+   
+   //--------------------------------------------------------------
+   
+   void CServer::finalize(void) // manager 0, method 1
+   {
+      boost::shared_ptr<CContext> context =
+         CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+      dtreat->finalize() ;
+
+       comm::CMPIManager::Barrier(CMPIManager::GetCommClientServer());
+   }   
+
+   //--------------------------------------------------------------
+
+   void CServer::setTimestep(const std::vector<CLinearBuffer> & buffer)// manager 1, method 2
+   {
+      boost::shared_ptr<CContext> context =
+         CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+
+      StdString durationstr;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         StdString durationstr_ = buffer[i].getString(3);
+         if (durationstr.compare(durationstr_) != 0 && (i != 0))
+         {
+            ERROR("CServer::setTimestep(const std::vector<CLinearBuffer> & buffer)",
+                  << "[ durationstr 1 = " << durationstr   << ", "
+                  << "[ durationstr 2 = " << durationstr_  << "] "
+                  << " Modification de timestep dÃ©synchronisÃ© !");
+         }
+         else durationstr = durationstr_;
+
+      }
+      dtreat->set_timestep(date::CDuration::FromString(durationstr));
+   }
+
+   //--------------------------------------------------------------
+             
+   void CServer::setContext(const std::vector<CLinearBuffer> & buffer) // manager 1, method 0
+   { 
+      StdString contextId;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         StdString contextId_ = buffer[i].getString(3);
+         if (contextId.compare(contextId_) != 0 && (i != 0))
+         {
+            ERROR("CServer::setContext(const std::vector<CLinearBuffer> & buffer)", 
+                  << "[ contextId 1 = " << contextId   << ", "
+                  << "[ contextId 2 = " << contextId_  << "] "
+                  << " Changement de contexte dÃ©synchronisÃ© !");
+         }
+         else contextId = contextId_;
+         
+      }
+      CTreeManager::SetCurrentContextId(contextId);
+   }
+   
+   //--------------------------------------------------------------
+   
+   void CServer::updateCalendar(const std::vector<CLinearBuffer> & buffer) // manager 1, method 1
+   {
+      boost::shared_ptr<CContext> context =
+         CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+
+      int timestep = -1;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         int timestep_ = buffer[i].getInt(3);
+         if ((timestep_ != timestep)  && (i != 0))
+         {
+            ERROR("CServer::updateCalendar(const std::vector<CLinearBuffer> & buffer)", 
+                  << "[ timestep 1 = " << timestep   << ", "
+                  << "[ timestep 2 = " << timestep_  << "] "
+                  << " Mise Ã  jour du calendrier dÃ©synchronisÃ©e !");
+         }
+         else timestep = timestep_;
+      }
+      dtreat->update_calendar(timestep);
+   }
+   
+   //--------------------------------------------------------------
+         
+   void CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)  // manager 2, method 0 - 1
+   {
+      boost::shared_ptr<CContext> context =
+         CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId());
+      boost::shared_ptr<data::CDataTreatment> dtreat = context->getDataTreatment();
+
+      StdString fieldId, fileId;
+      for (StdSize i = 0; i < buffer.size(); i++)
+      {
+         StdString fieldId_ = buffer[i].getString(3);
+         StdString fileId_ = buffer[i].getString(4);
+
+         if (fieldId.compare(fieldId_) != 0 && (i != 0))
+         {           
+            ERROR("CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)", 
+                  << "[fieldId 1 = " << fieldId   << ", "
+                  << " fieldId 2 = " << fieldId_  << "] "
+                  << " Ecriture des donnÃ©es dÃ©synchronisÃ©e !");
+         }
+         else fieldId = fieldId_;
+
+         if (fileId.compare(fileId_) != 0 && (i != 0))
+         {
+            ERROR("CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)",
+                  << "[fileId 1 = " << fileId   << ", "
+                  << " fileId 2 = " << fileId_  << "] "
+                  << " Ecriture des donnÃ©es dÃ©synchronisÃ©e !");
+         }
+         else fileId = fileId_;
+      }
+      
+      if (prec == 4)
+      {
+         std::deque<ARRAY(float, 1)> dataArray(buffer.size());
+         for (StdSize i = 0; i < buffer.size(); i++)
+            dataArray[i] = buffer[i].getFloatArray(5);
+         // Jamais atteint car les donnÃ©es sont transfÃ©rÃ©es en tant que double
+         return;
+      }      
+      else if (prec == 8)
+      {
+         std::deque<ARRAY(double, 1)> dataArray(buffer.size());
+         for (StdSize i = 0; i < buffer.size(); i++)
+            dataArray[i] = buffer[i].getDoubleArray(5);
+         dtreat->write_data(fieldId, fileId, dataArray);
+         return;
+      }      
+      else
+      {
+         ERROR("CServer::writeData(const std::vector<CLinearBuffer> & buffer, int prec)", 
+               << " PrÃ©cision des donnÃ©es invalide !");
+      }
+   }
+  
+   ///--------------------------------------------------------------
+   
+   
+} // namespace comm
+} // namespace xmlioserver
Index: /XIOS/trunk/src/server.hpp
===================================================================
--- /XIOS/trunk/src/server.hpp	(revision 306)
+++ /XIOS/trunk/src/server.hpp	(revision 306)
@@ -0,0 +1,59 @@
+#ifndef __XMLIO_Server__
+#define __XMLIO_Server__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "mpi_manager.hpp"
+#include "buffer_list.hpp"
+#include "array.hpp"
+
+namespace xmlioserver {
+namespace comm {
+
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   
+   class CServer
+   {
+      public :
+
+         static boost::shared_ptr<CServer> CreateServer(MPI_Comm comm_client_server);
+         static boost::shared_ptr<CServer> GetServer(void);
+
+         /// Destructeur ///
+         ~CServer(void);
+         
+         void run(void);
+         
+      protected : 
+      
+         /// Accesseur ///
+         const CBufferList & getBufferList(void) const;
+         
+      public :
+      
+         /// Appels distants///   
+         void initialize(void); // manager 0, method 0
+         void finalize(void);   // manager 0, method 1
+             
+         void setContext    (const std::vector<CLinearBuffer> & buffer); // manager 1, method 0
+         void updateCalendar(const std::vector<CLinearBuffer> & buffer); // manager 1, method 1
+         void setTimestep   (const std::vector<CLinearBuffer> & buffer); // manager 1, method 2
+         
+         void writeData(const std::vector<CLinearBuffer> & buffer, int prec); // manager 2, method 0 - 1
+      
+      private :
+
+         /// Constructeurs ///
+         CServer(MPI_Comm comm_client_server);
+      
+         /// PropriÃ©tÃ© privÃ©e ///
+         CBufferList blist;
+
+         static boost::shared_ptr<CServer> Server;
+      
+   }; // class CServer  
+
+} // namespace comm
+} // namespace xmlioserver
+
+#endif //__XMLIO_Server__
Index: /XIOS/trunk/src/server_main.f90
===================================================================
--- /XIOS/trunk/src/server_main.f90	(revision 306)
+++ /XIOS/trunk/src/server_main.f90	(revision 306)
@@ -0,0 +1,10 @@
+PROGRAM server_main
+  USE xios
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+  INTEGER :: ierr
+  
+!    CALL MPI_INIT(ierr)  
+    CALL xios_init_server
+!    CALL MPI_FINALIZE(ierr)  
+  END PROGRAM server_main
Index: /XIOS/trunk/src/server_ym.cpp
===================================================================
--- /XIOS/trunk/src/server_ym.cpp	(revision 306)
+++ /XIOS/trunk/src/server_ym.cpp	(revision 306)
@@ -0,0 +1,381 @@
+#include "xmlioserver_spl.hpp"
+#include "cxios.hpp"
+#include "server_ym.hpp"
+#include "type.hpp"
+#include "buffer.hpp"
+#include "context.hpp"
+#include "object_template_impl.hpp"
+#include "tree_manager.hpp"
+#include "oasis_cinterface.hpp"
+#include <boost/functional/hash.hpp>
+#include <boost/algorithm/string.hpp>
+#include <mpi.h>
+
+namespace xmlioserver
+{                      
+  namespace ym
+  {
+
+    MPI_Comm CServer::intraComm ;
+    list<MPI_Comm> CServer::interComm ;
+    bool CServer::isRoot ;
+    int CServer::rank ;
+    map<string,CContext*> CServer::contextList ;    
+    bool CServer::finished=false ;
+    bool CServer::is_MPI_Initialized ;
+    
+    void CServer::initialize(void)
+    {
+      int initialized ;
+      MPI_Initialized(&initialized) ;
+      if (initialized) is_MPI_Initialized=true ;
+      else is_MPI_Initialized=false ;
+            
+      // Not using OASIS
+      if (!CXios::usingOasis)
+      {
+        
+        if (!is_MPI_Initialized) 
+        {
+          int argc=0;
+          char** argv=NULL;
+          MPI_Init(&argc,&argv) ;
+        }
+         
+        boost::hash<string> hashString ;    
+      
+        unsigned long hashServer=hashString(CXios::xiosCodeId) ;
+        unsigned long* hashAll ;
+      
+        int rank ;
+        int size ;
+        int myColor ;
+        int i,c ;
+        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) ;
+
+        map<unsigned long, int> colors ;
+        map<unsigned long, int> leaders ;
+        map<unsigned long, int>::iterator it ;
+      
+        for(i=0,c=0;i<size;i++)
+        {
+          if (colors.find(hashAll[i])==colors.end())
+          {
+            colors[hashAll[i]]=c ;
+            leaders[hashAll[i]]=i ;
+            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 ;
+           
+             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ;
+             interComm.push_back(newComm) ;
+           }
+         }
+
+         delete [] hashAll ;
+      }
+      // using OASIS
+      else
+      {
+        int rank ,size;
+        if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId) ;
+        oasis_get_localcomm(intraComm) ;
+        MPI_Comm_rank(intraComm,&rank) ;
+        MPI_Comm_size(intraComm,&size) ;
+        string codesId=CXios::getin<string>("oasis_codes_id") ;
+         
+        vector<string> splitted ;
+        boost::split( splitted, codesId, boost::is_space(), boost::token_compress_on ) ;
+        vector<string>::iterator it ;
+
+        MPI_Comm newComm ;
+        int globalRank ;
+        MPI_Comm_rank(CXios::globalComm,&globalRank);
+        
+        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) ;
+        }
+      }
+      
+      int rank ;
+      MPI_Comm_rank(intraComm,&rank) ;
+      if (rank==0) isRoot=true;
+      else isRoot=false; 
+      eventLoop() ;
+      finalize() ;
+    }
+    
+    void CServer::finalize(void)
+    {
+      if (!is_MPI_Initialized)
+      { 
+        if (CXios::usingOasis) oasis_finalize();
+        else MPI_Finalize() ;
+      }
+    }
+    
+     void CServer::eventLoop(void)
+     {
+       bool stop=false ;
+       
+       while(!stop)
+       {
+         if (isRoot)
+         {
+           listenContext();
+           if (!finished) listenFinalize() ;
+         }
+         else
+         {
+           listenRootContext();
+           if (!finished) listenRootFinalize() ;
+         }
+       
+         contextEventLoop() ;
+         if (finished && contextList.empty()) stop=true ;
+       }
+     
+     }
+     
+     void CServer::listenFinalize(void)
+     {
+        list<MPI_Comm>::iterator it;
+        int msg ;
+        int flag ;
+        
+        for(it=interComm.begin();it!=interComm.end();it++)
+        {
+           MPI_Status status ;
+           MPI_Iprobe(0,0,*it,&flag,&status) ;
+           if (flag==true)
+           {
+              MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ;
+              info(20)<<" CServer : Receive client finalize"<<endl ;
+              interComm.erase(it) ;
+              break ;
+            }
+         }
+         
+         if (interComm.empty())
+         {
+           int i,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(&msg,1,MPI_INT,i,4,intraComm,&requests[i-1]) ;
+           MPI_Waitall(size-1,requests,status) ;
+
+           finished=true ;
+           delete [] requests ;
+           delete [] status ;
+         }
+     }
+      
+     
+     void CServer::listenRootFinalize()
+     {
+        int flag ;
+        MPI_Status status ;
+        int msg ;
+        
+        MPI_Iprobe(0,4,intraComm, &flag, &status) ;
+        if (flag==true)
+        {
+           MPI_Recv(&msg,1,MPI_INT,0,4,intraComm,&status) ;
+           finished=true ;
+        }
+      }
+      
+     void CServer::listenContext(void)
+     {
+       
+       MPI_Status status ;
+       int flag ;
+       static void* buffer ;
+       static MPI_Request request ;
+       static bool recept=false ;
+       int rank ;
+       int count ;
+       
+       if (recept==false)
+       {
+         MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ;
+         if (flag==true) 
+         {
+           rank=status.MPI_SOURCE ;
+           MPI_Get_count(&status,MPI_CHAR,&count) ;
+           buffer=new char[count] ;
+           MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;
+           recept=true ;   
+         }
+       }
+       else
+       {
+         MPI_Test(&request,&flag,&status) ;
+         if (flag==true)
+         {
+           rank=status.MPI_SOURCE ;
+           MPI_Get_count(&status,MPI_CHAR,&count) ;
+           recvContextMessage(buffer,count) ;
+           delete [] buffer ;
+           recept=false ;         
+         }
+       }
+     }
+     
+     void CServer::recvContextMessage(void* buff,int count)
+     {
+ 
+       
+       static map<string,contextMessage> recvContextId ;
+       map<string,contextMessage>::iterator it ;
+       
+       CBufferIn buffer(buff,count) ;
+       string id ;
+       int clientLeader ;
+       int nbMessage ;
+
+       buffer>>id>>nbMessage>>clientLeader ;
+                       
+       it=recvContextId.find(id) ;
+       if (it==recvContextId.end())
+       {         
+         contextMessage msg={0,0} ;
+         pair<map<string,contextMessage>::iterator,bool> ret ;
+         ret=recvContextId.insert(pair<string,contextMessage>(id,msg)) ;
+         it=ret.first ;
+       }  
+       it->second.nbRecv+=1 ;
+       it->second.leaderRank+=clientLeader ;
+         
+       if (it->second.nbRecv==nbMessage)
+       { 
+         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) ;
+
+         recvContextId.erase(it) ;
+         delete [] requests ;
+         delete [] status ;
+
+       }
+     }     
+     
+     void CServer::listenRootContext(void)
+     {
+       
+       MPI_Status status ;
+       int flag ;
+       static void* buffer ;
+       static MPI_Request request ;
+       static bool recept=false ;
+       int rank ;
+       int count ;
+       const int root=0 ;
+       
+       if (recept==false)
+       {
+         MPI_Iprobe(root,2,intraComm, &flag, &status) ;
+         if (flag==true) 
+         {
+           MPI_Get_count(&status,MPI_CHAR,&count) ;
+           buffer=new char[count] ;
+           MPI_Irecv(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(buffer,count) ;
+           delete [] buffer ;
+           recept=false ;         
+         }
+       }
+     } 
+     
+     
+     
+     void CServer::registerContext(void* buff,int count, int leaderRank)
+     {
+     
+       string contextId;
+       CBufferIn buffer(buff,count) ;
+
+       buffer>>contextId ;
+       MPI_Comm contextIntercomm ;
+       MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm) ;
+       
+       info(20)<<"CServer : Register new Context : "<<contextId<<endl  ;
+       MPI_Comm inter ;
+       MPI_Intercomm_merge(contextIntercomm,1,&inter) ;
+       MPI_Barrier(inter) ;
+       if (contextList.find(contextId)!=contextList.end()) 
+        ERROR("void CServer::registerContext(void* buff,int count, int leaderRank)",
+              <<"Context has already been registred") ;
+      
+//      tree::CContext* ptr ;
+//      if (tree::CContext::has(contextId)) ptr=tree::CContext::get(contextId).get() ;
+//      else ptr=tree::CContext::create(contextId).get() ;
+      shared_ptr<CContext> context=tree::CTreeManager::CreateContext(contextId) ;
+      contextList[contextId]=context.get() ;
+      context->initServer(intraComm,contextIntercomm) ;
+             
+     }    
+     
+     
+     void CServer::contextEventLoop(void)
+     {
+       bool finished ;
+       map<string,CContext*>::iterator it ;
+       for(it=contextList.begin();it!=contextList.end();it++) 
+       {
+         finished=it->second->eventLoop() ;
+         if (finished)
+         {
+           contextList.erase(it) ;
+           break ;
+         }
+       }
+         
+     }
+     
+
+
+  }
+}
Index: /XIOS/trunk/src/server_ym.hpp
===================================================================
--- /XIOS/trunk/src/server_ym.hpp	(revision 306)
+++ /XIOS/trunk/src/server_ym.hpp	(revision 306)
@@ -0,0 +1,45 @@
+#ifndef __SERVER_YM__HPP__
+#define __SERVER_YM__HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "context.hpp"
+#include <mpi.h>
+
+namespace xmlioserver
+{
+  namespace ym
+  {
+    class CServer
+    {
+       public:
+       
+       static void initialize(void) ;
+       static void finalize(void) ;
+       static void eventLoop(void) ;
+       static void contextEventLoop(void) ;
+       static void listenContext(void) ;
+       static void listenFinalize(void) ;
+       static void recvContextMessage(void* buff,int count) ;
+       static void listenRootContext(void) ;
+       static void listenRootFinalize(void) ;
+       static void registerContext(void* buff,int count, int leaderRank=0) ;
+       
+       static MPI_Comm intraComm ;
+       static list<MPI_Comm> interComm ;
+
+       struct contextMessage
+       {
+         int nbRecv ;
+         int leaderRank ;
+       } ;
+       
+      static bool isRoot ;
+      static int rank ;
+      static map<string,CContext*> contextList ;
+      static bool finished ;
+      static bool is_MPI_Initialized ;
+    } ;
+  }
+}
+
+#endif
Index: /XIOS/trunk/src/test/test.cpp
===================================================================
--- /XIOS/trunk/src/test/test.cpp	(revision 306)
+++ /XIOS/trunk/src/test/test.cpp	(revision 306)
@@ -0,0 +1,29 @@
+#include <iostream>
+#include <sstream>
+#include <string>
+
+using namespace std ;
+
+
+class CLog : public ostream
+{
+   public :
+   CLog() : ostream(NULL),level(0) {}
+   CLog& operator()(int l) {if (l<=level) rdbuf(cout.rdbuf()) ; else rdbuf(NULL) ; return *this;}
+   void setLevel(int l) {level=l; } 
+   int level ;
+//   ostringstream& getStream() { return *(ostringstream*)(this) ; }
+//   ~CLog(void) { cout<<"info message "<< this->str();}
+};
+
+
+int main(void)
+{
+  CLog out ;
+  cout<<string("toto")<<endl ;
+  out<<"123"<<endl ;
+  out.setLevel(5) ;
+  out(7)<<"coucou 1"<<endl ;
+  out(3)<<"coucou 2"<<endl<<"i23"<<endl ;
+  
+}
Index: /XIOS/trunk/src/test/test_cs.f90
===================================================================
--- /XIOS/trunk/src/test/test_cs.f90	(revision 306)
+++ /XIOS/trunk/src/test/test_cs.f90	(revision 306)
@@ -0,0 +1,121 @@
+PROGRAM test_cs
+IMPLICIT NONE
+  INCLUDE "mpif.h"
+  INTEGER :: rank
+  INTEGER :: size
+  INTEGER :: ierr
+  
+  CALL MPI_INIT(ierr)
+  CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr)
+  CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr)
+  
+  IF (rank<3) THEN
+   CALL client("client",rank,3)
+  ELSE 
+    CALL server
+  ENDIF
+  
+  
+  CALL MPI_FINALIZE(ierr)
+  
+END PROGRAM test_cs
+
+  SUBROUTINE client(id,rank,size)
+  USE xios
+  IMPLICIT NONE
+  INCLUDE 'mpif.h'
+  CHARACTER(len=*) :: id
+  INTEGER :: rank
+  INTEGER :: size
+  INTEGER :: comm
+  TYPE(xios_time)      :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  INTEGER,PARAMETER :: ni_glo=10 
+  INTEGER,PARAMETER :: nj_glo=10 
+  TYPE(xios_field) :: field_hdl
+  TYPE(xios_fieldgroup) :: fieldgroup_hdl
+  TYPE(xios_file) :: file_hdl
+  
+  
+  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo,field_A_glo
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:)
+  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
+  INTEGER :: i,j,ts,n
+  
+  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
+      field_A_glo(i,j)=(i-1)+(j-1)*ni_glo
+    ENDDO
+  ENDDO
+  ni=ni_glo ; ibegin=1
+
+  jbegin=1
+  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))
+  lon(:,:)=lon_glo(ibegin:iend,jbegin:jend)
+  lat(:,:)=lat_glo(ibegin:iend,jbegin:jend)
+  field_A(1:ni,1:nj)=field_A_glo(ibegin:iend,jbegin:jend)
+  
+
+  CALL xios_initialize(id,local_comm=MPI_COMM_WORLD,return_comm=comm)
+
+  CALL xios_context_initialize("test",comm)
+  CALL xios_get_handle("test",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+  
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_context_attr("test",start_date="01/01/2000 - 00:00:00")
+  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
+  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
+  CALL xios_set_domain_attr("domain_A",zoom_ni=3,zoom_ibegin=3,zoom_nj=3,zoom_jbegin=6)
+  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=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
+  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("output",file_hdl)
+  CALL xios_add_child(file_hdl,field_hdl)
+  CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_C")
+    
+ 
+    dtime%second=3600
+    CALL xios_set_timestep(dtime) 
+
+    CALL xios_close_context_definition()
+    DO ts=1,96
+      CALL xios_update_calendar(ts)
+      CALL xios_send_field("field_A",field_A)
+    ENDDO
+  
+    CALL xios_context_finalize()
+    CALL xios_finalize()
+     
+  END SUBROUTINE client
+  
+
+  
+  SUBROUTINE server
+  USE xios
+  IMPLICIT NONE
+  
+    CALL xios_init_server
+ 
+  END SUBROUTINE server
+  
+
+  
Index: /XIOS/trunk/src/test/test_xios.cpp
===================================================================
--- /XIOS/trunk/src/test/test_xios.cpp	(revision 306)
+++ /XIOS/trunk/src/test/test_xios.cpp	(revision 306)
@@ -0,0 +1,136 @@
+#include "xmlioserver.hpp"
+#include "attribute_template_impl.hpp"
+/*
+#include "group_template_impl.hpp"
+#include "file.hpp"
+*/
+#include "buffer_out.hpp"
+#include "buffer_in.hpp"
+#include "type.hpp"
+#include "cxios.hpp"
+#include "client_ym.hpp"
+#include "event_client.hpp"
+#include "context.hpp"
+#include "context_client.hpp"
+#include "context_server.hpp"
+#include "object_template_impl.hpp"
+#include <mpi.h>
+
+
+using namespace std ;
+using namespace ym ;
+
+int main (int argc, char ** argv, char ** UNUSED (env))
+{
+  
+  int a=3 ;
+  int b=2 ;
+  int c=1 ;
+  int buff[100] ;
+  string str("titi") ;
+   CBufferOut bufferOut(&buff,sizeof(buff)) ;
+   CBufferIn  bufferIn(&buff,sizeof(buff)) ;
+   CMessage msg ;
+/*
+   msg<<(int)3<<(int)2<<(int)1<<str ;
+//   msg<<a<<b<<c ;
+   std::cout<<"message size : "<<msg.size()<<std::endl ;
+   str="turlututu" ;
+   bufferOut<<msg ;
+   msg.clear() ;
+   msg<<a<<b<<c<<str ;
+//   bufferIn>>c>>b>>a>>str ;
+   bufferIn>>msg ;
+   std::cout<<a<<"  "<<b<<"  "<<c<<"  "<<str<<endl ;
+*/
+//   CAttributeTemplate<ARRAY(double,1)> tabIn ;
+ //  CAttributeTemplate<ARRAY(double,1)> tabOut ;
+   CAttributeTemplate<ARRAY(double,1)> tabIn("in") ;
+   CAttributeTemplate<ARRAY(double,1)> tabOut("out") ;
+
+   ARRAY_CREATE(tab,double,1,[5]) ; 
+ //   tab->resize(extents[5]) ;
+    (*tab)[0]=0 ; (*tab)[1]=1 ;(*tab)[2]=2 ; (*tab)[3]=3 ;(*tab)[4]=4 ;
+    tabIn=tab ;
+    (*tab)[0]=4 ; (*tab)[1]=3 ;(*tab)[2]=2 ; (*tab)[3]=1 ;(*tab)[4]=0 ;
+    tabOut=tab ;
+//   tabOut=1 ;
+   tabIn.toBuffer(bufferOut) ;
+   tabOut.fromBuffer(bufferIn) ;
+   
+   cout<<"attribut<Arraydouble,5>>="<<tabOut.toString()<<endl ;
+   
+   MPI_Init(&argc,&argv) ;
+   int rank ;
+   int size ;
+   char buffer[128] ;
+   
+   MPI_Comm_rank(MPI_COMM_WORLD,&rank) ;
+   if (rank>=0 && rank<=1) 
+   {
+     CXios::initClientSide("test1") ;
+     ym::CClient::registerContext("toto",ym::CClient::intraComm) ;
+//     ym::CClient::registerContext("tata",ym::CClient::intraComm) ;
+     ym::CClient::registerContext("tutu",ym::CClient::intraComm) ;
+     CObjectFactory::SetCurrentContextId("tutu") ;
+     CContext*  tutu=(CObjectFactory::GetObject<CContext>("tutu")).get(); 
+     
+     
+     CObjectFactory::SetCurrentContextId("toto") ;
+     CContext*  toto=(CObjectFactory::GetObject<CContext>("toto")).get(); 
+     toto->calendar_type.setValue("NoLeap") ;
+     toto->sendAttributToServer("calendar_type" );
+
+
+       for(int i=0;i<0;i++)
+       {
+         CMessage msg ;
+         int count ;
+         int msgSize; 
+         CEventClient event(1,1) ;
+         count=rand()%32 ;
+         msg<<string("toto")<<string(buffer,count)<<rank<<msgSize;
+         msgSize=msg.size() ;
+         event.push(0,2,msg) ;
+         event.push(1,2,msg) ;
+         toto->client->sendEvent(event) ;
+         cout<<"Send Event from toto : size "<<msgSize<<endl ;
+       }
+     toto->client->finalize() ;
+     tutu->client->finalize() ;
+     CXios::clientFinalize() ;
+   }
+   else if (rank>=2 && rank<=3) CXios::initServerSide();
+   else if (rank>=4 && rank<=6) 
+   {
+     CXios::initClientSide("test2") ;
+     ym::CClient::registerContext("tito",ym::CClient::intraComm) ;
+     CObjectFactory::SetCurrentContextId("tito") ;
+     CContext*  tito=(CObjectFactory::GetObject<CContext>("tito")).get();
+      
+     ym::CClient::registerContext("tete",ym::CClient::intraComm) ;
+     CObjectFactory::SetCurrentContextId("tete") ;
+     CContext*  tete=(CObjectFactory::GetObject<CContext>("tete")).get(); 
+
+     tito->client->finalize() ;
+     tete->client->finalize() ;
+     CXios::clientFinalize() ;
+   } 
+   else if (rank>=7 && rank<=7) 
+   {
+     CXios::initClientSide("test3") ;
+     ym::CClient::registerContext("turlututu",ym::CClient::intraComm) ;
+     CObjectFactory::SetCurrentContextId("turlututu") ;
+     CContext*  turlututu=(CObjectFactory::GetObject<CContext>("turlututu")).get(); 
+     turlututu->client->finalize() ;
+     CXios::clientFinalize() ;
+   }
+   
+   
+  
+   MPI_Barrier(MPI_COMM_WORLD); 
+   MPI_Finalize() ;
+
+  return EXIT_SUCCESS ;
+ 
+}
Index: /XIOS/trunk/src/transfert_parameters.hpp
===================================================================
--- /XIOS/trunk/src/transfert_parameters.hpp	(revision 306)
+++ /XIOS/trunk/src/transfert_parameters.hpp	(revision 306)
@@ -0,0 +1,18 @@
+#ifndef __TRANSFERT_PARAMETERS_HPP__
+#define __TRANSFERT_PARAMETERS_HPP__
+
+
+
+#define CLASS_ID_CONTEXT 1
+#define CLASS_ID_FIELD 2
+#define CLASS_ID_FILE 3
+#define CLASS_ID_AXIS 3
+#define CLASS_ID_DOMAIN 4
+#define CLASS_ID_GRID 5
+
+#define TYPE_ID_FINALIZE 2
+#define TYPE_ID_SEND_ATTR 3
+
+
+
+#endif
Index: /XIOS/trunk/src/xml_node.cpp
===================================================================
--- /XIOS/trunk/src/xml_node.cpp	(revision 306)
+++ /XIOS/trunk/src/xml_node.cpp	(revision 306)
@@ -0,0 +1,101 @@
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      StdString CXMLNode::RootName("simulation");
+
+      CXMLNode::CXMLNode(rapidxml::xml_node<char> * const root)
+         : node(root)
+         , level(0)
+      { /* Ne rien faire de plus */ }
+
+      CXMLNode::~CXMLNode(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CXMLNode::getElementName(void) const
+      { 
+         return (this->node->name()); 
+      }
+
+      bool CXMLNode::goToNextElement(void)
+      {
+         bool retvalue = false;
+         for(rapidxml::xml_node<char> * nextElement = this->node->next_sibling();
+                                      ; nextElement = this->node->next_sibling())
+         {
+            if (nextElement == NULL) break;
+            else if (nextElement->type() == rapidxml::node_element)
+            { 
+               node = nextElement;
+               return (!retvalue);
+            }
+         }
+         return (retvalue);
+      }
+
+      bool CXMLNode::goToChildElement(void)
+      {
+         bool retvalue = false;
+         rapidxml::xml_node<char> * nextElement = this->node->first_node();
+         if (nextElement != NULL)
+         {
+            for(;;nextElement = this->node->next_sibling())
+            {
+               if (nextElement == NULL) break;
+               else if (nextElement->type() == rapidxml::node_element)
+               { 
+                  node = nextElement;
+                  level++;
+                  return (!retvalue); 
+               }
+            }
+         }
+         return (retvalue);
+      }
+
+      bool CXMLNode::goToParentElement(void)
+      {
+         bool retvalue = false;
+         if (!(this->getElementName().compare(CXMLNode::RootName)) || (level == 0))
+            return (retvalue);
+         node = node->parent();
+         level--;
+         return (!retvalue);
+      }
+
+      bool CXMLNode::getContent(StdString & content)
+      {
+         if (this->node->value_size() == 0) return (false);
+         content.assign(this->node->value(), this->node->value_size());
+         return (true);
+      }
+
+      const StdString & CXMLNode::GetRootName(void)
+      { 
+         return (CXMLNode::RootName); 
+      }
+
+      THashAttributes CXMLNode::getAttributes(void) const
+      {
+         THashAttributes attributes;
+         rapidxml::xml_attribute<char> *currentAttr = NULL;
+
+         if ((currentAttr = this->node->first_attribute()) != NULL)
+         {
+            do 
+            {
+               attributes.insert(std::pair<StdString, StdString>
+                                (StdString(currentAttr->name()),
+                                 StdString(currentAttr->value())));
+            } while ((currentAttr = currentAttr->next_attribute()) != NULL);
+         }
+
+         return (attributes) ;
+      }
+
+   }// namespace xml
+} // namespace xmlioserve
Index: /XIOS/trunk/src/xml_node.hpp
===================================================================
--- /XIOS/trunk/src/xml_node.hpp	(revision 306)
+++ /XIOS/trunk/src/xml_node.hpp	(revision 306)
@@ -0,0 +1,57 @@
+#ifndef __XMLIO_CXMLNode__
+#define __XMLIO_CXMLNode__
+
+/// rapidXML headers ///
+#include <rapidxml.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef xios_map<StdString, StdString> THashAttributes;
+
+      class CXMLNode
+      {
+         public :
+
+            /// Constructeurs ///
+            CXMLNode(rapidxml::xml_node<char> * const root);
+
+            /// Destructeur ///
+            ~CXMLNode(void);
+
+            /// Accesseurs ///
+            StdString getElementName(void) const;
+            THashAttributes getAttributes(void) const;
+
+            /// Mutateurs ///
+            bool goToNextElement(void);
+            bool goToChildElement(void);
+            bool goToParentElement(void);
+            bool getContent(StdString & content);
+
+            /// Accesseurs statiques ///
+            static const StdString & GetRootName(void);
+
+         private :
+
+            /// Constructeurs ///
+            CXMLNode(void);                        // Not implemented yet.
+            CXMLNode(const CXMLNode & node);       // Not implemented yet.
+            CXMLNode(const CXMLNode * const node); // Not implemented yet.
+
+            rapidxml::xml_node<char> * node;
+            int level;
+
+            static StdString RootName;
+
+      }; //class CXMLParser
+
+   }// namespace xml
+} // namespace xmlioserver
+
+#endif // __XMLIO_CXMLNode__
Index: /XIOS/trunk/src/xml_parser.cpp
===================================================================
--- /XIOS/trunk/src/xml_parser.cpp	(revision 306)
+++ /XIOS/trunk/src/xml_parser.cpp	(revision 306)
@@ -0,0 +1,94 @@
+#include "xml_parser.hpp"
+
+#include "context.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      void CXMLParser::ParseFile(const StdString & filename)
+      {
+         StdIFStream ifs ( filename.c_str() , StdIFStream::in );
+         CXMLParser::ParseStream(ifs);
+      }
+
+      void CXMLParser::ParseString(const StdString & xmlContent)
+      {
+         StdIStringStream iss ( xmlContent /*, StdIStringStream::in*/ );
+         CXMLParser::ParseStream(iss);
+      }
+
+      void CXMLParser::ParseStream(StdIStream & stream)
+      {
+         if (!stream.good())
+            ERROR("CXMLParser::ParseStream(const StdIStream & stream)",
+                  << "Bad xml stream !");
+         StdOStringStream oss;
+         while(!stream.eof() && !stream.fail ())
+            oss.put(stream.get());
+         try
+         {
+            //const StdString xmlcontent( oss.str(), 0, oss.str().size()-2); //<POURQUOI ?
+            const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 );
+            rapidxml::xml_document<char> doc;
+            doc.parse<0>(const_cast<char*>(xmlcontent.c_str()));
+
+            CXMLNode node(doc.first_node());
+            THashAttributes attributes;
+
+            if (node.getElementName().compare(CXMLNode::GetRootName()) != 0)
+               ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                     << "Root element should be named simulation (actual = \'"
+                     << node.getElementName() << "\')!");
+
+            if (node.goToChildElement())
+            {
+               do
+               {
+                  boost::shared_ptr<tree::CContextGroup> group_context =
+                                    tree::CContext::GetContextGroup();
+                  attributes = node.getAttributes();
+
+                  if (attributes.end() == attributes.find("id"))
+                  {  
+                     DEBUG("Le context ne sera pas traitÃ© car il n'est pas identifiÃ© !");
+                     continue; 
+                  }
+
+                  CObjectFactory::SetCurrentContextId(attributes["id"]);
+                  CGroupFactory::SetCurrentContextId(attributes["id"]);
+
+                  bool hasctxt = CObjectFactory::HasObject<tree::CContext>(attributes["id"]);
+
+                  if(hasctxt)
+                  {  
+                     DEBUG("Le context ne sera pas traitÃ© car "
+                           << "il existe dÃ©jÃ  un autre context possÃ©dant le mÃªme nom !");
+                     continue; 
+                  }
+
+                  boost::shared_ptr<tree::CContext> context =
+                     CObjectFactory::CreateObject<tree::CContext>(attributes["id"]);
+                  if (!hasctxt) CGroupFactory::AddChild(group_context, context);
+                  context->parse(node);
+
+                  attributes.clear();
+
+               } while (node.goToNextElement());
+            }
+         }
+         catch (rapidxml::parse_error & exc)
+         {
+            ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                  << "RapidXML error : " << exc.what() << " !");
+         }
+      }
+
+   }// namespace xml
+} // namespace xmlioserver
Index: /XIOS/trunk/src/xml_parser.hpp
===================================================================
--- /XIOS/trunk/src/xml_parser.hpp	(revision 306)
+++ /XIOS/trunk/src/xml_parser.hpp	(revision 306)
@@ -0,0 +1,51 @@
+#ifndef __XMLIO_CXMLParser__
+#define __XMLIO_CXMLParser__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "xml_node.hpp"
+
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CXMLParser
+      {
+         public :
+
+            static void ParseFile(const StdString & filename);
+            static void ParseString(const StdString & xmlContent);
+            static void ParseStream(StdIStream & stream);
+            template <class T>
+               static inline void ParseInclude(StdIStream & stream, T & object);
+
+      }; //class CXMLParser
+
+      template <class T>
+         void CXMLParser::ParseInclude(StdIStream & stream, T& object)
+      {
+         StdOStringStream oss;
+         while(!stream.eof() && !stream.fail ())
+            oss.put(stream.get());
+         try
+         {
+            const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 );
+            rapidxml::xml_document<char> doc;
+            doc.parse<0>(const_cast<char*>(xmlcontent.c_str()));
+            CXMLNode node(doc.first_node());
+            object.parse(node);
+         }
+         catch (rapidxml::parse_error & exc)
+         {
+            ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                  << "RapidXML error : " << exc.what() << " !");
+         }
+      }
+
+   }// namespace xml
+} // namespace xmlioserver
+
+#endif // __XMLIO_CXMLParser__
Index: /XIOS/trunk/src/xmlioserver.hpp
===================================================================
--- /XIOS/trunk/src/xmlioserver.hpp	(revision 306)
+++ /XIOS/trunk/src/xmlioserver.hpp	(revision 306)
@@ -0,0 +1,24 @@
+#ifndef __XMLIO__
+#define __XMLIO__
+
+#include "xmlioserver_spl.hpp"
+
+/// xmlioserver headers ///
+#include "mpi_manager.hpp"
+#include "tree_manager.hpp"
+#include "xios_manager.hpp"
+#include "data_treatment.hpp"
+#include "nc4_data_output.hpp"
+
+//#include "data_manager.hpp"
+//#include "time_manager.hpp"
+
+using namespace xmlioserver;
+using namespace xmlioserver::data;
+using namespace xmlioserver::io;
+using namespace xmlioserver::tree;
+using namespace xmlioserver::xml;
+using namespace xmlioserver::comm;
+using namespace xmlioserver::func;
+
+#endif //__XMLIO__
Index: /XIOS/trunk/src/xmlioserver_spl.hpp
===================================================================
--- /XIOS/trunk/src/xmlioserver_spl.hpp	(revision 306)
+++ /XIOS/trunk/src/xmlioserver_spl.hpp	(revision 306)
@@ -0,0 +1,59 @@
+#ifndef __XMLIO_SPL__
+#define __XMLIO_SPL__
+
+/// standard C++ headers ///
+#include <utility>
+#include <string>
+#include <algorithm>
+
+// standard C
+#include <cstring>
+#include <cstdlib>
+#include <cmath>
+#include <ctime>
+
+// Conteneurs.
+#include <vector>
+#include <set>
+#include <stack>
+#include <list>
+#include <map>
+#include <deque>
+#include <valarray>
+// Flux.
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+/// boost headers ///
+//#include <boost/unordered_map.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/cast.hpp>
+/// Map ///
+#define xios_map std::map
+
+/// Macro ///
+#define UNUSED(parameter)
+
+/// DÃ©finition de types (issus de la bibliothÃšque standard)///
+typedef std::ostringstream StdOStringStream;
+typedef std::istringstream StdIStringStream;
+typedef std::ofstream      StdOFStream;
+typedef std::ifstream      StdIFStream;
+typedef std::ostream       StdOStream;
+typedef std::istream       StdIStream;
+typedef std::string        StdString;
+typedef std::size_t        StdSize;
+
+typedef  unsigned short int   ushort;
+typedef  unsigned int         uint;
+typedef  unsigned long int    ulong;
+
+/// xmlioserver headers ///
+#include "configure.hpp"
+#include "log.hpp"
+using namespace std;
+using namespace boost ;
+
+
+#endif //__XMLIO_SPL__
