Index: XMLIO_SERVER/trunk/.cache/.bld_pp
===================================================================
--- XMLIO_SERVER/trunk/.cache/.bld_pp	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/.bld_pp	(revision 8)
@@ -0,0 +1,1 @@
+PP 1
Index: XMLIO_SERVER/trunk/.cache/.bld_tool
===================================================================
--- XMLIO_SERVER/trunk/.cache/.bld_tool	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/.bld_tool	(revision 8)
@@ -0,0 +1,36 @@
+CC           cc
+CPP_INCLUDE  -I
+MIRROR       rsync
+FC_DEFINE    -D
+LD_LIBLINK   -l
+FFLAGS       -i4 -r8 -automatic -align all -I/opt/mpi/current/include -O3 -I/usr/include -I/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/../XMLF90_FCM/inc -I/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/../lib
+LD           mpif90
+FPP          cpp
+GENINTERFACE none
+LDFLAGS      -i4 -r8 -automatic -L/usr/lib -lnetcdff -lnetcdf -L/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/../XMLF90_FCM/lib -lxmlf90 -L/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/../lib -lioipsl
+FPP_DEFINE   -D
+MAKE_SILENT  -s
+CFLAGS       
+FC_INCLUDE   -I
+FPPFLAGS     -P -traditional
+FPP_INCLUDE  -I
+FC_OUTPUT    -o
+MAKE         gmake
+REMOTE_SHELL remsh
+LD_OUTPUT    -o
+CC_INCLUDE   -I
+MAKEFLAGS    
+INTERFACE    file
+FC           mpif90
+CPP_DEFINE   -D
+ARFLAGS      rs
+CPP          cpp
+LD_LIBSEARCH -L
+CC_DEFINE    -D
+MAKE_JOB     -j
+FC_COMPILE   -c
+AR           ar
+CC_COMPILE   -c
+CPPFLAGS     -C
+SHELL        /usr/bin/ksh
+CC_OUTPUT    -o
Index: XMLIO_SERVER/trunk/.cache/.exe_dep
===================================================================
--- XMLIO_SERVER/trunk/.cache/.exe_dep	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/.exe_dep	(revision 8)
@@ -0,0 +1,1 @@
+# EXE_DEP cache
Index: XMLIO_SERVER/trunk/.cache/ioserver.pck_depend
===================================================================
--- XMLIO_SERVER/trunk/.cache/ioserver.pck_depend	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/ioserver.pck_depend	(revision 8)
@@ -0,0 +1,63 @@
+INTNAME mpitrace.f90::mpitrace
+INTNAME mod_mpi_buffer_client.f90::mod_mpi_buffer_client
+INTNAME mod_ioserver_para.f90::mod_ioserver_para
+INTNAME mod_mpi_buffer_server.f90::mod_mpi_buffer_server
+INTNAME mod_boxed_domain.f90::boxed_domain
+INTNAME mod_wait.f90::mod_wait
+INTNAME server.f90::server
+INTNAME mod_field_bufferize.f90::field_bufferize
+INTNAME mod_event_server.f90::mod_event_server
+INTNAME init_vampir.f90::init_vampir
+INTNAME mod_iomanager.f90::iomanager
+INTNAME main.f90::ioslave
+INTNAME mod_box_grid.f90::box_grid
+INTNAME mod_global_memory.f90::mod_global_memory
+INTNAME mod_ioclient.f90::mod_ioclient
+INTNAME mod_pack.f90::mod_pack
+INTNAME mod_interface_ioipsl.f90::mod_interface_ioipsl
+INTNAME mod_ioclient_para.f90::mod_ioclient_para
+INTNAME mod_prec.f90::mod_prec
+INTNAME mod_event_parameters.f90::mod_event_parameters
+INTNAME mod_mpi_buffer_parameters.f90::mod_mpi_buffer_parameters
+INTNAME pack_f.f90::packf_r
+INTNAME mod_event_client.f90::mod_event_client
+USE     mod_mpi_buffer_client.f90::mod_global_memory
+USE     mod_mpi_buffer_client.f90::mod_pack
+USE     mod_mpi_buffer_client.f90::mpitrace
+USE     mod_mpi_buffer_client.f90::mod_mpi_buffer_parameters
+USE     mod_mpi_buffer_client.f90::mod_wait
+USE     mod_mpi_buffer_client.f90::mod_ioclient_para
+USE     mod_ioserver_para.f90::mpitrace
+USE     mod_mpi_buffer_server.f90::mod_global_memory
+USE     mod_mpi_buffer_server.f90::mpitrace
+USE     mod_mpi_buffer_server.f90::mod_pack
+USE     mod_mpi_buffer_server.f90::mod_mpi_buffer_parameters
+USE     mod_mpi_buffer_server.f90::mod_wait
+USE     mod_mpi_buffer_server.f90::mod_event_server
+USE     mod_mpi_buffer_server.f90::mod_ioserver_para
+USE     server.f90::mod_global_memory
+USE     server.f90::mod_wait
+USE     server.f90::mod_interface_ioipsl
+USE     server.f90::mod_ioserver_para
+USE     server.f90::iomanager
+USE     server.f90::mod_mpi_buffer_server
+USE     mod_event_server.f90::mod_pack
+USE     mod_event_server.f90::mod_event_parameters
+USE     mod_event_server.f90::iomanager
+USE     init_vampir.f90::mpitrace
+USE     mod_iomanager.f90::field_bufferize
+USE     mod_iomanager.f90::xmlio
+USE     mod_iomanager.f90::mod_interface_ioipsl
+USE     main.f90::mod_pack
+USE     main.f90::mod_wait
+USE     mod_ioclient.f90::mod_wait
+USE     mod_ioclient.f90::mod_mpi_buffer_client
+USE     mod_ioclient.f90::mod_ioclient_para
+USE     mod_interface_ioipsl.f90::xmlio
+USE     mod_interface_ioipsl.f90::mod_ioserver_para
+USE     mod_ioclient_para.f90::mpitrace
+USE     pack_f.f90::mod_prec
+USE     mod_event_client.f90::mod_pack
+USE     mod_event_client.f90::mod_event_parameters
+USE     mod_event_client.f90::mod_mpi_buffer_client
+USE     mod_event_client.f90::iomanager
Index: XMLIO_SERVER/trunk/.cache/ioserver.pck_file
===================================================================
--- XMLIO_SERVER/trunk/.cache/ioserver.pck_file	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/ioserver.pck_file	(revision 8)
@@ -0,0 +1,24 @@
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/pack_c.c.old                 
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/main.f90                      FORTRAN::FORTRAN9X::SOURCE::PROGRAM
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_event_client.f90          FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_event_parameters.f90      FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_event_server.f90          FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_global_memory.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_ioclient_para.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_ioserver_para.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_mpi_buffer_client.f90     FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_mpi_buffer_parameters.f90 FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_mpi_buffer_server.f90     FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_pack.f90                  FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_prec.f90                  FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_wait.f90                  FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_field_bufferize.f90       FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_box_grid.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/pack_f.f90                    FORTRAN::FORTRAN9X::SOURCE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/server.f90                    FORTRAN::FORTRAN9X::SOURCE::PROGRAM
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mpitrace.F90                  FPP::FPP9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_iomanager.f90             FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/init_vampir.f90               FORTRAN::FORTRAN9X::SOURCE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_interface_ioipsl.f90      FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_boxed_domain.f90          FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/IOSERVER/mod_ioclient.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
Index: XMLIO_SERVER/trunk/.cache/ioserver.pck_ppdepend
===================================================================
--- XMLIO_SERVER/trunk/.cache/ioserver.pck_ppdepend	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/ioserver.pck_ppdepend	(revision 8)
@@ -0,0 +1,1 @@
+
Index: XMLIO_SERVER/trunk/.cache/xmlio.pck_depend
===================================================================
--- XMLIO_SERVER/trunk/.cache/xmlio.pck_depend	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/xmlio.pck_depend	(revision 8)
@@ -0,0 +1,139 @@
+INTNAME mod_grid.f90::mod_grid
+INTNAME mod_axis_definition.f90::mod_axis_definition
+INTNAME mod_error_msg.f90::error_msg
+INTNAME mod_file_group.f90::mod_file_group
+INTNAME mod_dependency.f90::mod_dependency
+INTNAME mod_grid_definition.f90::mod_grid_definition
+INTNAME mod_field_group.f90::mod_field_group
+INTNAME test_xmlio.f90::test_xmlio
+INTNAME mod_file_definition.f90::mod_file_definition
+INTNAME mod_axis.f90::mod_axis
+INTNAME mod_domain.f90::mod_domain
+INTNAME string_function.f90::string_function
+INTNAME mod_file.f90::mod_file
+INTNAME mod_sorted_list.f90::mod_sorted_list
+INTNAME mod_parse_xml.f90::parsing_xml
+INTNAME mod_xmlio_parameters.f90::mod_xmlio_parameters
+INTNAME mod_grid_group.f90::mod_grid_group
+INTNAME mod_axis_group.f90::mod_axis_group
+INTNAME xmlio.f90::xmlio
+INTNAME mod_field.f90::mod_field
+INTNAME mod_field_definition.f90::mod_field_definition
+USE     vector_grid_group_contains.inc::mod_xmlio_parameters
+USE     vector_field_dep_contains.inc::mod_xmlio_parameters
+USE     mod_grid.f90::mod_domain
+USE     mod_grid.f90::mod_xmlio_parameters
+INC     mod_grid.f90::vector_grid_def.inc
+INC     mod_grid.f90::vector_grid_contains.inc
+USE     mod_grid.f90::mod_sorted_list
+USE     mod_grid.f90::string_function
+USE     mod_axis_definition.f90::mod_axis_group
+USE     vector_domain_contains.inc::mod_xmlio_parameters
+USE     mod_error_msg.f90::mod_xmlio_parameters
+USE     mod_file_group.f90::mod_xmlio_parameters
+INC     mod_file_group.f90::vector_file_group_def.inc
+USE     mod_file_group.f90::mod_file
+INC     mod_file_group.f90::vector_file_group_contains.inc
+USE     mod_file_group.f90::string_function
+USE     mod_dependency.f90::mod_axis
+INC     mod_dependency.f90::vector_field_out_def.inc
+INC     mod_dependency.f90::vector_field_dep_contains.inc
+USE     mod_dependency.f90::mod_file_group
+USE     mod_dependency.f90::mod_grid
+INC     mod_dependency.f90::vector_file_dep_def.inc
+INC     mod_dependency.f90::vector_field_out_contains.inc
+INC     mod_dependency.f90::vector_field_dep_def.inc
+USE     mod_dependency.f90::mod_field
+USE     mod_dependency.f90::mod_file
+USE     mod_dependency.f90::mod_file_definition
+INC     mod_dependency.f90::vector_file_dep_contains.inc
+USE     mod_dependency.f90::mod_sorted_list
+USE     mod_dependency.f90::string_function
+USE     vector_file_contains.inc::mod_xmlio_parameters
+USE     vector_field_contains.inc::mod_xmlio_parameters
+USE     vector_grid_contains.inc::mod_xmlio_parameters
+USE     mod_grid_definition.f90::mod_grid_group
+INC     mod_field_group.f90::vector_field_group_contains.inc
+USE     mod_field_group.f90::mod_field
+USE     mod_field_group.f90::mod_xmlio_parameters
+INC     mod_field_group.f90::vector_field_group_def.inc
+USE     mod_field_group.f90::string_function
+USE     test_xmlio.f90::xmlio
+USE     test_xmlio.f90::mod_interface_ioipsl
+USE     mod_file_definition.f90::mod_file_group
+INC     mod_axis.f90::vector_axis_def.inc
+INC     mod_axis.f90::vector_axis_contains.inc
+USE     mod_axis.f90::error_msg
+USE     mod_axis.f90::mod_xmlio_parameters
+USE     mod_axis.f90::mod_sorted_list
+USE     mod_axis.f90::string_function
+USE     mod_domain.f90::error_msg
+USE     mod_domain.f90::mod_xmlio_parameters
+INC     mod_domain.f90::vector_domain_def.inc
+INC     mod_domain.f90::vector_domain_contains.inc
+USE     string_function.f90::error_msg
+USE     vector_file_group_contains.inc::mod_xmlio_parameters
+USE     vector_field_out_contains.inc::mod_xmlio_parameters
+USE     vector_axis_group_contains.inc::mod_xmlio_parameters
+USE     vector_field_group_contains.inc::mod_xmlio_parameters
+USE     mod_file.f90::mod_field_group
+INC     mod_file.f90::vector_file_contains.inc
+USE     mod_file.f90::error_msg
+USE     mod_file.f90::mod_xmlio_parameters
+INC     mod_file.f90::vector_file_def.inc
+USE     mod_file.f90::mod_sorted_list
+USE     mod_file.f90::string_function
+INC     mod_sorted_list.f90::vector_node_def.inc
+INC     mod_sorted_list.f90::vector_node_contains.inc
+USE     mod_parse_xml.f90::mod_axis
+USE     mod_parse_xml.f90::mod_axis_definition
+USE     mod_parse_xml.f90::mod_field_definition
+USE     mod_parse_xml.f90::mod_file_group
+USE     mod_parse_xml.f90::mod_axis_group
+USE     mod_parse_xml.f90::mod_grid
+USE     mod_parse_xml.f90::mod_grid_definition
+USE     mod_parse_xml.f90::mod_grid_group
+USE     mod_parse_xml.f90::error_msg
+USE     mod_parse_xml.f90::mod_field_group
+USE     mod_parse_xml.f90::mod_field
+USE     mod_parse_xml.f90::mod_file_definition
+USE     mod_parse_xml.f90::mod_file
+USE     mod_parse_xml.f90::string_function
+INC     mod_grid_group.f90::vector_grid_group_contains.inc
+USE     mod_grid_group.f90::mod_xmlio_parameters
+INC     mod_grid_group.f90::vector_grid_group_def.inc
+USE     mod_grid_group.f90::mod_grid
+USE     mod_grid_group.f90::string_function
+USE     vector_node_contains.inc::mod_xmlio_parameters
+USE     mod_axis_group.f90::mod_axis
+USE     mod_axis_group.f90::mod_xmlio_parameters
+INC     mod_axis_group.f90::vector_axis_group_def.inc
+INC     mod_axis_group.f90::vector_axis_group_contains.inc
+USE     mod_axis_group.f90::string_function
+USE     xmlio.f90::mod_field_definition
+USE     xmlio.f90::mod_axis_group
+USE     xmlio.f90::error_msg
+USE     xmlio.f90::mod_field
+USE     xmlio.f90::string_function
+USE     xmlio.f90::mod_axis
+USE     xmlio.f90::mod_axis_definition
+USE     xmlio.f90::parsing_xml
+USE     xmlio.f90::mod_file_group
+USE     xmlio.f90::mod_grid
+USE     xmlio.f90::mod_grid_definition
+USE     xmlio.f90::mod_grid_group
+USE     xmlio.f90::mod_field_group
+USE     xmlio.f90::mod_dependency
+USE     xmlio.f90::mod_file
+USE     xmlio.f90::mod_file_definition
+USE     vector_axis_contains.inc::mod_xmlio_parameters
+USE     mod_field.f90::mod_axis
+USE     mod_field.f90::mod_xmlio_parameters
+USE     mod_field.f90::mod_grid
+INC     mod_field.f90::vector_field_def.inc
+USE     mod_field.f90::error_msg
+USE     mod_field.f90::string_function
+INC     mod_field.f90::vector_field_contains.inc
+USE     mod_field.f90::mod_sorted_list
+USE     vector_file_dep_contains.inc::mod_xmlio_parameters
+USE     mod_field_definition.f90::mod_field_group
Index: XMLIO_SERVER/trunk/.cache/xmlio.pck_file
===================================================================
--- XMLIO_SERVER/trunk/.cache/xmlio.pck_file	(revision 8)
+++ XMLIO_SERVER/trunk/.cache/xmlio.pck_file	(revision 8)
@@ -0,0 +1,51 @@
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/create_template                
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_axis_definition.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_axis.f90                    FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_axis_group.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_dependency.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_domain.f90                  FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_error_msg.f90               FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_field_definition.f90        FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_field.f90                   FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_field_group.f90             FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_file_definition.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_file.f90                    FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_file_group.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_grid_definition.f90         FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_grid.f90                    FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_grid_group.f90              FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_parse_xml.f90               FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_sorted_list.f90             FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_vector_field.F90.old       
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/mod_xmlio_parameters.f90        FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/string_function.f90             FORTRAN::FORTRAN9X::SOURCE::MODULE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/test_xmlio.f90                  FORTRAN::FORTRAN9X::SOURCE::PROGRAM
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_axis_contains.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_axis_def.inc             FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_axis_group_contains.inc  FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_axis_group_def.inc       FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_contains.template       
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_def.template            
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_domain_contains.inc      FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_domain_def.inc           FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_contains.inc       FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_def.inc            FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_dep_contains.inc   FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_dep_def.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_group_contains.inc FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_group_def.inc      FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_out_contains.inc   FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_field_out_def.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_contains.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_def.inc             FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_dep_contains.inc    FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_dep_def.inc         FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_group_contains.inc  FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_file_group_def.inc       FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_grid_contains.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_grid_def.inc             FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_grid_group_contains.inc  FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_grid_group_def.inc       FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_node_contains.inc        FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/vector_node_def.inc             FORTRAN::FORTRAN9X::INCLUDE
+/work/cont003/p86yann/XMLIO_NEMO/XMLIO_SERVER_SVN/src/XMLIO/xmlio.f90                       FORTRAN::FORTRAN9X::SOURCE::MODULE
Index: XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.fcm
===================================================================
--- XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.fcm	(revision 8)
+++ XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.fcm	(revision 8)
@@ -0,0 +1,15 @@
+%COMPILER            mpif90
+%LINKER              mpif90
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional 
+%FPP_DEF             NC_DOUBLE BLAS SGEMV=DGEMV SGEMM=DGEMM FFT_MKL
+%BASE_FFLAGS         -i4 -r8 -automatic -align all -I/opt/mpi/current/include
+%PROD_FFLAGS         -O3
+%DEV_FFLAGS          -O3 -traceback
+%DEBUG_FFLAGS        -g -traceback
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -i4 -r8 -automatic
+%MPI_LD
+%OMP_LD              -openmp
Index: XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.path
===================================================================
--- XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.path	(revision 8)
+++ XMLIO_SERVER/trunk/arch/arch-IA64_PLATINE.path	(revision 8)
@@ -0,0 +1,12 @@
+set NETCDF_INCDIR="-I/usr/include"
+set NETCDF_LIBDIR="-L/usr/lib"
+set NETCDF_LIB="-lnetcdff -lnetcdf"
+set IOIPSL_INCDIR="-I$PWD/../lib"
+set IOIPSL_LIBDIR="-L$PWD/../lib"
+set IOIPSL_LIB="-lioipsl"
+set XMLF90_INCDIR="-I$PWD/../XMLF90_FCM/inc"
+set XMLF90_LIBDIR="-L$PWD/../XMLF90_FCM/lib"
+set XMLF90_LIB="-lxmlf90"
+set VAMPIR_INCDIR="-I/applications/intel/ict/3.0/itac/7.0/include"
+set VAMPIR_LIBDIR="-L/applications/intel/ict/3.0/itac/7.0/lib" 
+set VAMPIR_LIB="-lVT -lvtunwind -ldwarf -lelf -lpthread"
Index: XMLIO_SERVER/trunk/bld.cfg
===================================================================
--- XMLIO_SERVER/trunk/bld.cfg	(revision 8)
+++ XMLIO_SERVER/trunk/bld.cfg	(revision 8)
@@ -0,0 +1,46 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc arch.fcm
+inc config.fcm
+
+dir::root   $PWD
+
+search_src           0
+src::ioserver    src/IOSERVER
+src::xmlio       src/XMLIO
+bld::lib::ioserver         ioserver
+bld::lib::xmlio            xmlio
+bld::target libioserver.a libxmlio.a
+#bld::target main.exe client.exe server.exe
+bld::target server.exe
+
+bld::tool::fc        %COMPILER
+bld::tool::ld        %LINKER
+bld::tool::ar        %AR
+bld::tool::make      %MAKE
+bld::tool::fflags    %FFLAGS %INCDIR
+bld::tool::ldflags   %BASE_LD %LIB
+
+# Pre-process code before analysing dependencies
+bld::pp              1
+
+
+# Ignore the following dependencies
+bld::excl_dep        inc::VT.inc
+bld::excl_dep        use::ioipsl
+bld::excl_dep        use::flib_dom
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        use::mpi
+
+# Don't generate interface files
+bld::tool::geninterface none
+
+bld::outfile_ext::mod .mod
+
Index: XMLIO_SERVER/trunk/configure
===================================================================
--- XMLIO_SERVER/trunk/configure	(revision 8)
+++ XMLIO_SERVER/trunk/configure	(revision 8)
@@ -0,0 +1,134 @@
+#!/bin/csh
+set verbose echo
+set has_arch_opt           = FALSE 
+set has_compile_opt        = FALSE
+set default_compile_flags  = "%PROD_FFLAGS"
+set has_use_vt             = FALSE
+
+top:
+if ($#argv > 0) then
+    switch ($1)
+
+    case -h
+
+########################################################################
+# Manuel en ligne
+########################################################################
+more <<eod
+
+
+configure_ioserver [Options] 
+
+bla, bla, bla
+eod
+exit
+
+########################################################################
+# Lecture des differentes options
+########################################################################
+                   
+    case -a
+    case -arch
+        set has_arch_opt = TRUE
+        set arch="$2" ; shift ; shift ; goto top
+
+    case -prod
+        set has_compile_opt = TRUE
+        set compile_flags="%PROD_FFLAGS"
+        shift ; goto top
+
+    case -dev
+        set has_compile_opt = TRUE
+        set compile_flags="%DEV_FFLAGS"
+        shift ; goto top
+
+    case -debug
+        set has_compile_opt = TRUE
+        set compile_flags="%DEBUG_FFLAGS"
+        shift ; goto top
+    case -use_vt
+        set has_use_vt = TRUE
+        shift ; goto top
+        
+   default
+        echo "unknown option "$1" , exiting..."
+        exit 
+   endsw
+endif
+
+
+#define architecture files
+if ( $has_arch_opt == TRUE) then
+  if ( -e arch/arch-${arch}.fcm ) then
+    rm -f arch.fcm
+    ln -s arch/arch-${arch}.fcm arch.fcm
+  else
+    echo "architecture file : << arch/arch-${arch}.fcm >> is missing, exiting...."
+    exit
+  endif
+  
+  if ( -e arch/arch-${arch}.path ) then
+    rm -f arch.path
+    ln -s arch/arch-${arch}.path arch.path
+  else
+    echo "architecture file : << arch/arch-${arch}.path >> is missing, exiting...."
+    exit
+  endif
+else
+  echo "Warning : architecture not specified, taking default file <<arch.fcm>> and <<arch.path>>" 
+  if ( ! -e arch.fcm ) then
+    echo "architecture file : << arch.fcm >> is missing, exiting...."
+    exit
+  endif
+
+  if ( ! -e arch.fcm ) then
+    echo "architecture file : << arch.path >> is missing, exiting...."
+    exit
+  endif
+endif
+  
+# set compiler flags
+set FFLAGS="%BASE_FFLAGS"
+set LD_FFLAGS="%BASE_LD"
+set CPP_KEY="%FPP_DEF"
+set INCDIR=""
+set LIB=""
+
+source ./arch.path
+
+# set compiler flags for optimisation
+if ( $has_compile_opt == FALSE ) then
+  set compile_flags=$default_compile_flags
+endif
+set FFLAGS=${FFLAGS}" "$compile_flags
+
+# add path for netcdf library
+
+set INCDIR="$INCDIR $NETCDF_INCDIR"
+set LIB="$LIB $NETCDF_LIBDIR $NETCDF_LIB"
+
+# add path for xmlf90 library
+
+set INCDIR="$INCDIR $XMLF90_INCDIR"
+set LIB="$LIB $XMLF90_LIBDIR $XMLF90_LIB"
+
+# add path for ioipsl library
+set INCDIR="$INCDIR $IOIPSL_INCDIR"
+set LIB="$LIB $IOIPSL_LIBDIR $IOIPSL_LIB"
+
+if ( $has_use_vt == TRUE ) then
+set INCDIR="$INCDIR $VAMPIR_INCDIR"
+set LIB="$LIB $VAMPIR_LIBDIR $VAMPIR_LIB"
+set CPP_KEY="$CPP_KEY USE_VT"
+endif
+
+
+# build config file
+set config_fcm="config.fcm"
+rm -f $config_fcm
+
+echo "%FFLAGS        $FFLAGS"                           >  $config_fcm 
+echo "%CPP_KEY       $CPP_KEY"                          >> $config_fcm
+echo "%LD_FFLAGS     $LD_FFLAGS"                        >> $config_fcm
+echo "%INCDIR        $INCDIR"                           >> $config_fcm
+echo "%LIB           $LIB"                              >> $config_fcm
Index: XMLIO_SERVER/trunk/src/IOSERVER/init_vampir.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/init_vampir.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/init_vampir.f90	(revision 8)
@@ -0,0 +1,5 @@
+SUBROUTINE init_vampir
+USE mpitrace
+
+  CALL InitVampir
+END SUBROUTINE init_vampir
Index: XMLIO_SERVER/trunk/src/IOSERVER/main.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/main.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/main.f90	(revision 8)
@@ -0,0 +1,70 @@
+PROGRAM ioslave
+USE mod_pack, ONLY : set_pack_buffer,pack,unpack
+USE mod_wait
+IMPLICIT NONE
+
+  INTEGER,DIMENSION(3) :: a=(/1,2,3/)
+  REAL                 :: b = 4.5
+  REAL                 :: c = 6.7
+  INTEGER,DIMENSION(3) :: aout
+  REAL                 :: bout,cout
+  LOGICAL,DIMENSION(5) :: d=(/.TRUE.,.FALSE.,.FALSE.,.TRUE.,.TRUE./)
+  LOGICAL,DIMENSION(5) :: dout
+  CHARACTER            :: e='C'
+  CHARACTER            :: eout
+  CHARACTER(len=11)    :: f(3)
+  CHARACTER(len=11)    :: fout(3)
+  INTEGER(kind=8),dimension(:),POINTER :: buffer
+  REAL,dimension(:),POINTER :: buffer_field
+  DOUBLE PRECISION :: t
+  
+  ALLOCATE(buffer(1024))
+  ALLOCATE(buffer_field(1024))
+  
+  CALL set_pack_buffer(buffer,1)
+  
+  f(1)="COUCOU1"
+  f(2)="COUCOU2"
+  f(3)="COUCOU3"
+  
+  CALL pack(b)
+  CALL pack(f)
+  CALL pack(a)
+  CALL pack(d)
+  CALL pack(e)
+  CALL pack(c)
+  
+  CALL set_pack_buffer(buffer,1)
+  CALL unpack(bout)
+  CALL unpack(fout)
+  CALL unpack(aout)
+  CALL unpack(dout)
+  CALL unpack(eout)
+  CALL unpack(cout)
+  
+  PRINT *,a,b,c,d,e,"  ",f
+  PRINT *,aout,bout,cout,dout,eout,"  ",fout
+
+  CALL Init_wait
+  
+  t=top()
+  CALL wait_us(10)
+  t=top()
+  
+  PRINT *,"ATTENTE 10 us",t
+
+  t=top()
+  CALL wait_us(250)
+  t=top()
+  
+  PRINT *,"ATTENTE 250 us",t
+
+  t=top()
+  CALL wait_us(1235)
+  t=top()
+  
+  PRINT *,"ATTENTE 1235 us",t
+
+
+END PROGRAM ioslave
+
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_box_grid.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_box_grid.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_box_grid.f90	(revision 8)
@@ -0,0 +1,170 @@
+MODULE box_grid
+  
+  INTEGER, PARAMETER :: nb_grid_max=100
+  INTEGER            :: nb_grid=0
+
+  TYPE domain
+    INTEGER :: ni
+    INTEGER :: nj
+    INTEGER :: ibegin
+    INTEGER :: iend
+    INTEGER :: jbegin
+    INTEGER :: jend
+    REAL,POINTER :: lon(:,:)
+    REAL,POINTER :: lat(:,:)
+  END TYPE domain
+  
+  TYPE grid
+    TYPE(domain)         :: local_domain
+    TYPE(domain),POINTER :: task_domain(:)
+    INTEGER                          :: ni
+    INTEGER                          :: nj
+    INTEGER                          :: nb_task
+  END TYPE grid
+  
+  TYPE(grid),SAVE,TARGET :: grids(nb_grid_max)
+  
+  INTEGER,SAVE :: max_ni
+  INTEGER,SAVE :: max_nj
+  INTEGER,SAVE :: max_vert_size = 100
+  REAL,SAVE,ALLOCATABLE :: Field_buffer(:,:,:) 
+  
+CONTAINS
+
+  SUBROUTINE create_new_grid(ni_glo,nj_glo,nb_task,id)
+  IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: ni_glo
+    INTEGER,INTENT(IN)  :: nj_glo
+    INTEGER,INTENT(IN)  :: nb_task
+    INTEGER,INTENT(OUT) :: id
+  
+    nb_grid=nb_grid+1
+    id=nb_grid
+    
+    grids(id)%ni=ni_glo
+    grids(id)%nj=nj_glo
+    grids(id)%nb_task=nb_task
+   
+    ALLOCATE(grids(id)%task_domain(nb_task))
+ 
+  END SUBROUTINE create_new_grid
+ 
+  SUBROUTINE Init_task_domain(id,task,ni,nj,ibegin,jbegin,lon,lat)
+  IMPLICIT NONE
+    INTEGER, INTENT(IN) :: id
+    INTEGER, INTENT(IN) :: task
+    INTEGER, INTENT(IN) :: ni
+    INTEGER, INTENT(IN) :: nj
+    INTEGER, INTENT(IN) :: ibegin
+    INTEGER, INTENT(IN) :: jbegin
+    REAL,    INTENT(IN) :: lon(ni,nj)
+    REAL,    INTENT(IN) :: lat(ni,nj)
+ 
+    TYPE(domain), POINTER :: Pt_dom
+    
+    Pt_dom=>grids(id)%task_domain(task)
+    
+    Pt_dom%ni=ni
+    Pt_dom%nj=nj
+    Pt_dom%ibegin=ibegin
+    Pt_dom%jbegin=jbegin   
+    Pt_dom%iend=ibegin+ni-1
+    Pt_dom%jend=jbegin+nj-1
+    ALLOCATE(Pt_dom%lon(ni,nj))
+    ALLOCATE(Pt_dom%lat(ni,nj))
+    Pt_dom%lon(:,:)=lon(:,:)
+    Pt_dom%lat(:,:)=lat(:,:)
+  
+  END SUBROUTINE Init_task_domain
+
+  
+  SUBROUTINE Init_grids
+  IMPLICIT NONE
+    INTEGER :: rank
+    INTEGER :: ib,ie,jb,je
+    TYPE(grid),POINTER :: Pt_grid
+    TYPE(domain),POINTER :: local_domain
+    TYPE(domain),POINTER :: task_domain(:)
+    INTEGER :: id
+    
+      max_ni=0
+      max_nj=0
+    
+      DO id=1,nb_grid
+        pt_grid=>grids(id)
+        local_domain=>pt_grid%local_domain
+        task_domain=>pt_grid%task_domain
+        
+        local_domain%ibegin=task_domain(1)%ibegin
+        local_domain%iend=task_domain(1)%iend
+        local_domain%jbegin=task_domain(1)%jbegin
+        local_domain%jend=task_domain(1)%jend
+      
+      DO rank=1,pt_grid%nb_task
+        IF (task_domain(rank)%ibegin < local_domain%ibegin)   local_domain%ibegin = task_domain(rank)%ibegin
+        IF (task_domain(rank)%iend   > local_domain%iend  )   local_domain%iend   = task_domain(rank)%iend
+        IF (task_domain(rank)%jbegin < local_domain%jbegin)   local_domain%jbegin = task_domain(rank)%jbegin
+        IF (task_domain(rank)%jend   > local_domain%jend  )   local_domain%jend   = task_domain(rank)%jend
+      ENDDO
+    
+      local_domain%ni = local_domain%iend-local_domain%ibegin+1
+      local_domain%nj = local_domain%jend-local_domain%jbegin+1
+      ALLOCATE(local_domain%lon(local_domain%ni,local_domain%nj))
+      ALLOCATE(local_domain%lat(local_domain%ni,local_domain%nj))
+      
+      DO rank=1,pt_grid%nb_task
+        ib=task_domain(rank)%ibegin-local_domain%ibegin+1
+        ie=task_domain(rank)%iend-local_domain%ibegin+1
+        jb=task_domain(rank)%jbegin-local_domain%jbegin+1
+        je=task_domain(rank)%jend-local_domain%jbegin+1
+
+        task_domain(rank)%ibegin=ib
+        task_domain(rank)%iend=ie
+        task_domain(rank)%jbegin=jb
+        task_domain(rank)%jend=je
+      
+        local_domain%lon(ib:ie,jb:je)=task_domain(rank)%lon(:,:)
+        local_domain%lat(ib:ie,jb:je)=task_domain(rank)%lat(:,:)
+      ENDDO
+  
+      IF (local_domain%ni > max_ni) max_ni=local_domain%ni
+      IF (local_domain%nj > max_nj) max_nj=local_domain%nj
+    ENDDO
+  
+    ALLOCATE(field_buffer(max_ni,max_nj,max_vert_size))
+    
+  END SUBROUTINE Init_grids
+  
+  SUBROUTINE bufferize_field2d(field,id,task)
+  IMPLICIT NONE
+    REAL,INTENT(IN) :: field(:,:)
+    INTEGER,INTENT(IN) :: id
+    INTEGER,INTENT(IN) :: task
+    TYPE(domain), POINTER :: Pt
+
+    Pt=>grids(id)%task_domain(task)
+    field_buffer(Pt%ibegin:Pt%iend,Pt%jbegin:Pt%jend,1)=field(:,:)
+      
+  END SUBROUTINE bufferize_field2d
+  
+  
+  SUBROUTINE bufferize_field3d(field,id,task)
+  IMPLICIT NONE
+    REAL,INTENT(IN) :: field(:,:,:)
+    INTEGER,INTENT(IN) :: id
+    INTEGER,INTENT(IN) :: task
+    TYPE(domain), POINTER :: Pt
+   
+    Pt=>grids(id)%task_domain(task)
+
+    IF (size(field,3)>max_vert_size) THEN
+      DEALLOCATE(field_buffer)
+      max_vert_size=max_vert_size*2
+      ALLOCATE(field_buffer(max_ni,max_nj,max_vert_size))
+    ENDIF
+    
+    field_buffer(Pt%ibegin:Pt%iend,Pt%jbegin:Pt%jend,1:size(field,3))=field(:,:,:)
+      
+  END SUBROUTINE bufferize_field3d
+    
+END MODULE box_grid
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_boxed_domain.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_boxed_domain.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_boxed_domain.f90	(revision 8)
@@ -0,0 +1,145 @@
+MODULE boxed_domain
+
+  INTEGER,SAVE :: ni_glo
+  INTEGER,SAVE :: nj_glo
+  INTEGER,SAVE :: nb_proc
+  
+  TYPE local_domain
+    INTEGER :: ni
+    INTEGER :: nj
+    INTEGER :: ibegin
+    INTEGER :: iend
+    INTEGER :: jbegin
+    INTEGER :: jend
+    REAL,ALLOCATABLE :: lon(:,:)
+    REAL,ALLOCATABLE :: lat(:,:)
+  END TYPE local_domain
+  
+  TYPE(local_domain),ALLOCATABLE,SAVE,TARGET :: domains(:)
+  
+  
+  INTEGER,SAVE :: ni
+  INTEGER,SAVE :: nj
+  INTEGER,SAVE :: ibegin
+  INTEGER,SAVE :: iend
+  INTEGER,SAVE :: jbegin
+  INTEGER,SAVE :: jend
+  
+  REAL,SAVE,ALLOCATABLE :: lon(:,:)
+  REAL,SAVE,ALLOCATABLE :: lat(:,:)
+  
+  INTEGER,SAVE :: max_vert_size = 100
+  REAL,SAVE,ALLOCATABLE :: Field_buffer(:,:,:)  
+  
+CONTAINS
+
+  SUBROUTINE Init_global_domain(ni_glo_,nj_glo_,nb_proc_)
+  IMPLICIT NONE
+  INTEGER, INTENT(IN) :: ni_glo_
+  INTEGER, INTENT(IN) :: nj_glo_
+  INTEGER, INTENT(IN) :: nb_proc_
+  
+    ni_glo=ni_glo_
+    nj_glo=nj_glo_
+    nb_proc=nb_proc_
+    
+    ALLOCATE(domains(nb_proc))
+ 
+  END SUBROUTINE Init_global_domain
+
+
+  SUBROUTINE Init_local_domain(rank,ni,nj,ibegin,jbegin,lon,lat)
+  IMPLICIT NONE
+    INTEGER, INTENT(IN) :: rank
+    INTEGER, INTENT(IN) :: ni
+    INTEGER, INTENT(IN) :: nj
+    INTEGER, INTENT(IN) :: ibegin    
+    INTEGER, INTENT(IN) :: jbegin
+    REAL, INTENT(IN)    :: lon(ni,nj)
+    REAL, INTENT(IN)    :: lat(ni,nj)
+    
+    domains(rank)%ni=ni
+    domains(rank)%nj=nj
+    domains(rank)%ibegin=ibegin
+    domains(rank)%jbegin=jbegin   
+    domains(rank)%iend=ibegin+ni-1
+    domains(rank)%jend=jbegin+nj-1
+    ALLOCATE(domains(rank)%lon(ni,nj))
+    ALLOCATE(domains(rank)%lat(ni,nj))
+    domains(rank)%lon(:,:)=lon(:,:)
+    domains(rank)%lat(:,:)=lat(:,:)
+  
+  END SUBROUTINE Init_local_domain
+  
+  
+  SUBROUTINE Init_domain
+  IMPLICIT NONE
+    INTEGER :: rank
+    INTEGER :: ib,ie,jb,je
+    ibegin=domains(1)%ibegin
+    iend=domains(1)%iend
+    jbegin=domains(1)%jbegin
+    jend=domains(1)%jend
+    
+    DO rank=1,nb_proc
+      IF (domains(rank)%ibegin<ibegin) ibegin=domains(rank)%ibegin
+      IF (domains(rank)%iend>iend) iend=domains(rank)%iend
+      IF (domains(rank)%jbegin<jbegin) jbegin=domains(rank)%jbegin
+      IF (domains(rank)%jend>jend) jend=domains(rank)%jend
+    ENDDO
+    
+    ni=iend-ibegin+1
+    nj=jend-jbegin+1
+    ALLOCATE(lon(ni,nj))
+    ALLOCATE(lat(ni,nj))
+    
+    DO rank=1,nb_proc
+      ib=domains(rank)%ibegin-ibegin+1
+      ie=domains(rank)%iend-ibegin+1
+      jb=domains(rank)%jbegin-jbegin+1
+      je=domains(rank)%jend-jbegin+1
+
+      domains(rank)%ibegin=ib
+      domains(rank)%iend=ie
+      domains(rank)%jbegin=jb
+      domains(rank)%jend=je
+      
+      lon(ib:ie,jb:je)=domains(rank)%lon(:,:)
+      lat(ib:ie,jb:je)=domains(rank)%lat(:,:)
+    ENDDO
+  
+    ALLOCATE(field_buffer(ni,nj,max_vert_size))
+    
+  END SUBROUTINE 
+  
+  SUBROUTINE bufferize_field2d(field,rank)
+  IMPLICIT NONE
+    REAL,INTENT(IN) :: field(:,:)
+    INTEGER,INTENT(IN) :: rank
+    TYPE(local_domain), POINTER :: Pt
+
+    Pt=>domains(rank)
+    field_buffer(Pt%ibegin:Pt%iend,Pt%jbegin:Pt%jend,1)=field(:,:)
+      
+  END SUBROUTINE bufferize_field2d
+  
+  
+  SUBROUTINE bufferize_field3d(field,rank)
+  IMPLICIT NONE
+    REAL,INTENT(IN) :: field(:,:,:)
+    INTEGER,INTENT(IN) :: rank
+    TYPE(local_domain), POINTER :: Pt
+   
+    Pt=>domains(rank)
+    IF (size(field,3)>max_vert_size) THEN
+      DEALLOCATE(field_buffer)
+      max_vert_size=max_vert_size*2
+      ALLOCATE(field_buffer(ni,nj,max_vert_size))
+    ENDIF
+    
+    field_buffer(Pt%ibegin:Pt%iend,Pt%jbegin:Pt%jend,1:size(field,3))=field(:,:,:)
+      
+  END SUBROUTINE bufferize_field3d
+
+    
+END MODULE boxed_domain
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90	(revision 8)
@@ -0,0 +1,249 @@
+MODULE mod_event_client
+  USE mod_pack, ONLY : pack, pack_field
+  USE mod_mpi_buffer_client, ONLY : create_request, finalize_request
+  USE mod_event_parameters 
+
+  LOGICAL, SAVE :: using_server
+      
+CONTAINS
+
+  SUBROUTINE event__parse_xml_file(filename)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: filename
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_parse_xml_file)
+      CALL pack(LEN(TRIM(filename)))
+      CALL pack(TRIM(filename))
+      CALL Finalize_request
+    ELSE
+      CALL iom__parse_xml_file(filename)
+    ENDIF
+    
+  END SUBROUTINE  event__parse_xml_file
+
+  SUBROUTINE event__set_vert_axis(vert_name,vert_value)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: vert_name
+    REAL,INTENT(IN)             :: vert_value(:)
+    
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_set_vert_axis)
+      CALL pack(LEN(TRIM(vert_name)))
+      CALL pack(TRIM(vert_name))
+      CALL pack(SIZE(vert_value))
+      CALL pack(vert_value)
+      CALL Finalize_request
+    ELSE
+      CALL iom__set_vert_axis(vert_name,vert_value)
+    ENDIF
+    
+  END SUBROUTINE  event__set_vert_axis
+
+  SUBROUTINE event__set_grid_dimension(name,ni_glo,nj_glo)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    INTEGER,INTENT(IN) :: ni_glo
+    INTEGER,INTENT(IN) :: nj_glo
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_set_grid_dimension)
+      CALL pack(LEN(TRIM(name)))
+      CALL pack(TRIM(name))
+      CALL pack(ni_glo)
+      CALL pack(nj_glo)
+      CALL Finalize_request
+    ELSE
+      CALL iom__set_grid_dimension(name,ni_glo,nj_glo)
+    ENDIF
+    
+  END SUBROUTINE event__set_grid_dimension
+
+  
+  SUBROUTINE event__set_grid_domain(name,ni,nj,ibegin,jbegin,lon,lat)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    INTEGER,INTENT(IN) :: ni
+    INTEGER,INTENT(IN) :: nj
+    INTEGER,INTENT(IN) :: ibegin
+    INTEGER,INTENT(IN) :: jbegin
+    REAL,INTENT(IN)    :: lon(ni,nj)
+    REAL,INTENT(IN)    :: lat(ni,nj)
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_set_grid_domain)
+      CALL pack(LEN(TRIM(name)))
+      CALL pack(TRIM(name))
+      CALL pack(ni)
+      CALL pack(nj)
+      CALL pack(ibegin)
+      CALL pack(jbegin)
+      CALL pack(lon)
+      CALL pack(lat)
+      CALL Finalize_request
+    ELSE
+     CALL iom__set_grid_domain(name,ni,nj,ibegin,jbegin,lon,lat)
+    ENDIF
+      
+  END SUBROUTINE event__set_grid_domain
+
+  SUBROUTINE event__set_grid_type_nemo(name)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_set_grid_type_nemo)
+      CALL pack(LEN(TRIM(name)))
+      CALL pack(TRIM(name))
+      CALL Finalize_request
+    ELSE
+     CALL iom__set_grid_type_nemo(name)
+    ENDIF
+      
+  END SUBROUTINE event__set_grid_type_nemo
+  
+  
+  SUBROUTINE event__set_time_parameters(itau0,zjulian,zdt)
+  USE iomanager
+  IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: itau0
+    REAL,   INTENT(IN)  :: zjulian
+    REAL,   INTENT(IN)  :: zdt
+        
+    IF (using_server) THEN
+      CALL create_request(event_id_set_time_parameters)
+      CALL pack(itau0)
+      CALL pack(zjulian)
+      CALL pack(zdt)
+      CALL Finalize_request
+    ELSE
+      CALL iom__set_time_parameters(itau0,zjulian,zdt)
+    ENDIF
+    
+  END SUBROUTINE event__set_time_parameters
+
+
+  SUBROUTINE event__enable_field(varname)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(len=*),INTENT(IN)     :: varname
+
+    IF (using_server) THEN
+      CALL create_request(event_id_enable_field)
+      CALL pack(len(varname))
+      CALL pack(varname)
+      CALL Finalize_request 
+    ELSE
+      CALL iom__enable_field(varname)
+    ENDIF
+    
+  END SUBROUTINE event__enable_field
+
+  SUBROUTINE event__disable_field(varname)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(len=*),INTENT(IN)     :: varname
+
+    IF (using_server) THEN
+      CALL create_request(event_id_disable_field)
+      CALL pack(len(varname))
+      CALL pack(varname)
+      CALL Finalize_request 
+    ELSE
+      CALL iom__disable_field(varname)
+    ENDIF
+    
+  END SUBROUTINE event__disable_field
+  
+  SUBROUTINE event__write_field2d(varname,var)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(len=*),INTENT(IN)     :: varname
+    REAL, DIMENSION(:,:),INTENT(IN) :: var
+
+    IF (using_server) THEN
+      CALL create_request(event_id_write_field2d)
+      CALL pack(len(varname))
+      CALL pack(size(var,1))
+      CALL pack(size(var,2))
+      CALL pack(varname)
+      CALL pack_field(var)
+      CALL Finalize_request 
+    ELSE
+      CALL iom__write_field2d(varname,var)
+    ENDIF
+    
+  END SUBROUTINE event__write_field2d
+  
+  SUBROUTINE event__write_field3d(varname,var)
+  USE iomanager
+  IMPLICIT NONE
+    CHARACTER(len=*),INTENT(IN)     :: varname
+    REAL, DIMENSION(:,:,:),INTENT(IN) :: var
+
+    IF (using_server) THEN
+      CALL create_request(event_id_write_field3d)
+      CALL pack(len(varname))
+      CALL pack(size(var,1))
+      CALL pack(size(var,2))
+      CALL pack(size(var,3))
+      CALL pack(varname)
+      CALL pack_field(var)
+      CALL Finalize_request 
+    ELSE
+      CALL iom__write_field3d(varname,var)
+    ENDIF
+  END SUBROUTINE event__write_field3d
+  
+
+  SUBROUTINE event__set_timestep(timestep)
+  USE iomanager
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: timestep
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_set_timestep)
+      CALL pack(timestep)
+      CALL Finalize_request
+    ELSE
+      CALL iom__set_timestep(timestep)
+    ENDIF
+
+  END SUBROUTINE event__set_timestep
+    
+    
+  SUBROUTINE event__close_io_definition
+  USE iomanager
+  IMPLICIT NONE
+    
+    IF (using_server) THEN
+      CALL create_request(event_id_close_io_definition)
+      CALL Finalize_request
+    ELSE
+      CALL iom__close_io_definition
+    ENDIF
+
+  END SUBROUTINE event__close_io_definition
+
+  
+  SUBROUTINE event__stop_ioserver
+  USE iomanager
+  IMPLICIT NONE
+ 
+    IF (using_server) THEN
+      CALL create_request(event_id_stop_ioserver)
+      CALL Finalize_request
+    ELSE
+      CALL iom__finalize
+    ENDIF
+
+  END SUBROUTINE event__stop_ioserver
+    
+  
+END MODULE mod_event_client
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_event_parameters.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_event_parameters.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_event_parameters.f90	(revision 8)
@@ -0,0 +1,16 @@
+MODULE mod_event_parameters
+  INTEGER, PARAMETER :: event_id_parse_xml_file        = 100
+  INTEGER, PARAMETER :: event_id_set_local_domain      = 101
+  INTEGER, PARAMETER :: event_id_set_vert_axis         = 102
+  INTEGER, PARAMETER :: event_id_set_time_parameters   = 103
+  INTEGER, PARAMETER :: event_id_set_timestep          = 104
+  INTEGER, PARAMETER :: event_id_write_field2d         = 105
+  INTEGER, PARAMETER :: event_id_write_field3d         = 106
+  INTEGER, PARAMETER :: event_id_close_io_definition   = 107
+  INTEGER, PARAMETER :: event_id_set_grid_dimension    = 108
+  INTEGER, PARAMETER :: event_id_set_grid_domain       = 109
+  INTEGER, PARAMETER :: event_id_set_grid_type_nemo    = 110
+  INTEGER, PARAMETER :: event_id_enable_field          = 111
+  INTEGER, PARAMETER :: event_id_disable_field         = 112
+  INTEGER, PARAMETER :: event_id_stop_ioserver         = 999
+END MODULE mod_event_parameters
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_event_server.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_event_server.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_event_server.f90	(revision 8)
@@ -0,0 +1,340 @@
+MODULE mod_event_server
+  USE mod_pack, ONLY : unpack, unpack_field
+  USE mod_event_parameters
+  USE iomanager
+  
+CONTAINS
+
+  SUBROUTINE Process_event(current_rank,is_terminated)
+  IMPLICIT NONE
+    INTEGER :: event_id
+    INTEGER, INTENT(IN) :: current_rank
+    LOGICAL,INTENT(OUT) :: is_terminated
+     
+    CALL iom__set_current_rank(current_rank)
+     
+    is_terminated=.FALSE.
+    
+    CALL unpack(event_id)
+    
+    SELECT CASE (event_id)
+    
+      CASE (event_id_parse_xml_file)
+        CALL event__parse_xml_file 
+
+      CASE (event_id_set_vert_axis)
+        CALL event__set_vert_axis 
+     
+      CASE (event_id_set_grid_dimension)
+        CALL event__set_grid_dimension
+      
+      CASE (event_id_set_grid_domain)
+        CALL event__set_grid_domain
+
+      CASE (event_id_set_grid_type_nemo)
+        CALL event__set_grid_type_nemo
+
+      CASE (event_id_set_time_parameters)
+        CALL event__set_time_parameters
+
+      CASE (event_id_close_io_definition)
+        CALL event__close_io_definition  
+
+      CASE (event_id_set_timestep)
+        CALL event__set_timestep
+
+      CASE (event_id_enable_field)
+        CALL event__enable_field
+      
+      CASE (event_id_disable_field)
+        CALL event__disable_field
+
+      CASE (event_id_write_Field2d)
+        CALL event__write_Field2d
+
+      CASE (event_id_write_Field3d)
+        CALL event__write_Field3d
+
+      CASE (event_id_stop_ioserver)
+        is_terminated=.TRUE.  
+        PRINT *,"TERMINATE_EVENT RECEIVED"
+
+      CASE DEFAULT 
+        STOP 'UNDEFINED EVENT'
+      
+     END SELECT
+     
+   END SUBROUTINE Process_event
+   
+
+  SUBROUTINE event__parse_xml_file
+  IMPLICIT NONE
+    INTEGER :: name_size
+   
+    CALL unpack(name_size)
+    CALL sub_internal(name_size)
+     
+  CONTAINS
+    
+    SUBROUTINE sub_internal(name_size)
+      INTEGER :: name_size
+      CHARACTER(LEN=name_size) :: filename     
+     
+       CALL unpack(filename)
+     
+       CALL iom__parse_xml_file(filename)
+     END SUBROUTINE sub_internal
+  
+  END SUBROUTINE event__parse_xml_file
+  
+  
+  SUBROUTINE event__set_grid_dimension
+  IMPLICIT NONE    
+    INTEGER :: name_size
+    INTEGER :: ni_glo
+    INTEGER :: nj_glo
+   
+    CALL unpack(name_size)
+    CALL sub_internal(name_size)
+     
+  CONTAINS
+    
+    SUBROUTINE sub_internal(name_size)
+      INTEGER :: name_size
+      CHARACTER(LEN=name_size) :: name     
+     
+       CALL unpack(name)
+       CALL unpack(ni_glo)
+       CALL unpack(nj_glo)
+     
+       CALL iom__set_grid_dimension(name,ni_glo,nj_glo)
+     END SUBROUTINE sub_internal
+   
+   END SUBROUTINE event__set_grid_dimension
+
+
+  SUBROUTINE event__set_grid_domain 
+  IMPLICIT NONE    
+    INTEGER :: name_size
+    INTEGER :: ni
+    INTEGER :: nj
+    INTEGER :: ibegin
+    INTEGER :: jbegin
+    REAL,ALLOCATABLE :: lon(:,:)
+    REAL,ALLOCATABLE :: lat(:,:)
+
+    CALL unpack(name_size)
+    CALL sub_internal(name_size)
+     
+  CONTAINS
+    
+    SUBROUTINE sub_internal(name_size)
+      INTEGER :: name_size
+      CHARACTER(LEN=name_size) :: name     
+     
+       CALL unpack(name)
+    
+       CALL unpack(ni)
+       CALL unpack(nj)
+       CALL unpack(ibegin)
+       CALL unpack(jbegin)
+    
+       ALLOCATE(lon(ni,nj))
+       ALLOCATE(lat(ni,nj))
+       CALL unpack(lon)
+       CALL unpack(lat)
+    
+       CALL iom__set_grid_domain(name,ni,nj,ibegin,jbegin,lon,lat)
+
+     END SUBROUTINE sub_internal
+   
+  END SUBROUTINE event__set_grid_domain   
+
+
+  SUBROUTINE event__set_grid_type_nemo 
+  IMPLICIT NONE    
+    INTEGER :: name_size
+
+    CALL unpack(name_size)
+    CALL sub_internal(name_size)
+     
+  CONTAINS
+    
+    SUBROUTINE sub_internal(name_size)
+      INTEGER :: name_size
+      CHARACTER(LEN=name_size) :: name     
+     
+       CALL unpack(name)
+       CALL iom__set_grid_type_nemo(name)
+
+     END SUBROUTINE sub_internal
+   
+  END SUBROUTINE event__set_grid_type_nemo   
+
+
+  SUBROUTINE event__set_vert_axis
+  IMPLICIT NONE
+    INTEGER :: name_size
+    INTEGER :: vert_size 
+    REAL,ALLOCATABLE :: vert_value(:)
+    
+    CALL unpack(name_size)
+    CALL sub_internal(name_size)
+
+  CONTAINS
+    
+    SUBROUTINE sub_internal(name_size)
+      INTEGER :: name_size
+      CHARACTER(LEN=name_size) :: name
+    
+      CALL unpack(name)
+      CALL unpack(vert_size)
+      ALLOCATE(vert_value(vert_size))
+      CALL unpack(vert_value) 
+      
+      CALL iom__set_vert_axis(name,vert_value)
+      
+    END SUBROUTINE sub_internal
+  END SUBROUTINE event__set_vert_axis
+
+  SUBROUTINE event__set_time_parameters
+  IMPLICIT NONE
+    INTEGER   :: itau0
+    REAL      :: zjulian
+    REAL      :: zdt
+      
+    CALL unpack(itau0)
+    CALL unpack(zjulian)
+    CALL unpack(zdt)
+    
+    CALL iom__set_time_parameters(itau0,zjulian,zdt)
+     
+  END SUBROUTINE event__set_time_parameters
+  
+
+  SUBROUTINE event__enable_field
+  IMPLICIT NONE
+    INTEGER :: lenc
+      
+    CALL unpack(lenc)
+    CALL sub_internal(lenc)
+  
+  CONTAINS
+    SUBROUTINE sub_internal(lenc)
+    IMPLICIT NONE
+      INTEGER :: lenc
+      CHARACTER(len=lenc) :: varname
+      
+      CALL unpack(varname)
+      
+      CALL iom__enable_field(varname)
+
+    END SUBROUTINE sub_internal
+  END SUBROUTINE event__enable_field
+  
+
+  SUBROUTINE event__disable_field
+  IMPLICIT NONE
+    INTEGER :: lenc
+      
+    CALL unpack(lenc)
+    CALL sub_internal(lenc)
+  
+  CONTAINS
+    SUBROUTINE sub_internal(lenc)
+    IMPLICIT NONE
+      INTEGER :: lenc
+      CHARACTER(len=lenc) :: varname
+      
+      CALL unpack(varname)
+      
+      CALL iom__disable_field(varname)
+
+    END SUBROUTINE sub_internal
+    
+  END SUBROUTINE event__disable_field
+  
+      
+  SUBROUTINE event__write_field2D
+  IMPLICIT NONE
+    INTEGER :: lenc
+    INTEGER :: dim1
+    INTEGER :: dim2
+      
+    CALL unpack(lenc)
+    CALL unpack(dim1)
+    CALL unpack(dim2)
+    CALL sub_internal(lenc,dim1,dim2)
+  
+  CONTAINS
+    SUBROUTINE sub_internal(lenc,dim1,dim2)
+    IMPLICIT NONE
+      INTEGER :: lenc
+      INTEGER :: dim1
+      INTEGER :: dim2
+      CHARACTER(len=lenc) :: varname
+      REAL                :: var(dim1,dim2)
+      
+      CALL unpack(varname)
+      CALL unpack_field(var)
+      
+      CALL iom__write_Field2d(varname,var)
+
+    END SUBROUTINE sub_internal
+  END SUBROUTINE event__write_field2d
+    
+    
+  SUBROUTINE event__write_field3d
+  IMPLICIT NONE
+    INTEGER :: lenc
+    INTEGER :: dim1
+    INTEGER :: dim2
+    INTEGER :: dim3
+    
+    CALL unpack(lenc)
+    CALL unpack(dim1)
+    CALL unpack(dim2)
+    CALL unpack(dim3)
+    CALL sub_internal(lenc,dim1,dim2,dim3)
+ 
+  CONTAINS
+ 
+    SUBROUTINE sub_internal(lenc,dim1,dim2,dim3)
+    IMPLICIT NONE
+      INTEGER :: lenc
+      INTEGER :: dim1
+      INTEGER :: dim2
+      INTEGER :: dim3
+ 
+      CHARACTER(len=lenc) :: varname
+      REAL                :: var(dim1,dim2,dim3)
+        
+      CALL unpack(varname)
+      CALL unpack_field(var)
+       
+      CALL iom__write_field3d(varname,var)
+         
+    END SUBROUTINE sub_internal
+
+  END SUBROUTINE event__write_field3d
+    
+    
+  SUBROUTINE event__set_timestep
+  IMPLICIT NONE
+    INTEGER :: timestep
+     
+    CALL unpack(timestep)
+    CALL iom__set_timestep(timestep)
+    
+  END SUBROUTINE event__set_timestep
+    
+    
+  SUBROUTINE event__close_io_definition
+  IMPLICIT NONE
+    
+    CALL iom__close_io_definition
+    
+  END SUBROUTINE event__close_io_definition
+    
+    
+END MODULE mod_event_server   
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_field_bufferize.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_field_bufferize.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_field_bufferize.f90	(revision 8)
@@ -0,0 +1,94 @@
+MODULE field_bufferize
+  
+  INTEGER,SAVE      :: nx=0
+  INTEGER,SAVE      :: ny=0
+  INTEGER,SAVE      :: nz=0
+    
+  REAL,POINTER,SAVE :: field_buffer(:,:,:)
+  
+
+  
+CONTAINS
+
+  SUBROUTINE bufferize_field(ni,ibegin,nj,jbegin,nk,kbegin,nbp,field,i_index,j_index,mask)
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: ni
+    INTEGER,INTENT(IN) :: ibegin
+    INTEGER,INTENT(IN) :: nj
+    INTEGER,INTENT(IN) :: jbegin
+    INTEGER,INTENT(IN) :: nk
+    INTEGER,INTENT(IN) :: kbegin
+    INTEGER,INTENT(IN) :: nbp
+    REAL,INTENT(IN)    :: field(nbp,nk)
+    INTEGER,INTENT(IN) :: i_index(nbp)
+    INTEGER,INTENT(IN) :: j_index(nbp)
+    LOGICAL,INTENT(IN),OPTIONAL :: mask(nbp)  
+    
+    INTEGER :: iend
+    INTEGER :: jend
+    INTEGER :: kend 
+
+    LOGICAL      :: need_reallocate
+    REAL,POINTER :: tmp_buffer(:,:,:)
+    INTEGER      :: i,j,k,n
+    
+    iend=ibegin+ni-1
+    jend=jbegin+nj-1
+    kend=kbegin+nk-1
+    
+    IF (PRESENT(mask)) THEN
+      DO k=kbegin,kend
+        DO n=1,nbp
+          i=i_index(n)+ibegin-1
+          j=j_index(n)+jbegin-1
+          IF (mask(n)) field_buffer(i,j,k)=field(n,k)
+        ENDDO
+      ENDDO
+    ELSE
+      DO k=kbegin,kend
+        DO n=1,nbp
+          i=i_index(n)+ibegin-1
+          j=j_index(n)+jbegin-1
+          field_buffer(i,j,k)=field(n,k)
+        ENDDO
+      ENDDO
+    ENDIF
+    
+  END SUBROUTINE bufferize_field
+
+  SUBROUTINE Init_field_Bufferize(ni,nj,nk)
+  IMPLICIT NONE
+  INTEGER,INTENT(IN) :: ni
+  INTEGER,INTENT(IN) :: nj
+  INTEGER,INTENT(IN) :: nk
+     
+    LOGICAL :: need_reallocate
+    
+    
+    need_reallocate=.FALSE.
+    
+    IF ( ni > nx) THEN
+      nx=ni
+      need_reallocate=.TRUE.
+    ENDIF
+    
+    IF ( nj > ny) THEN
+      ny=nj
+      need_reallocate=.TRUE.
+    ENDIF
+
+    IF ( nk > nz) THEN
+      nz=nk
+      need_reallocate=.TRUE.
+    ENDIF
+    
+    IF (need_reallocate) THEN
+      IF (ASSOCIATED(field_buffer)) DEALLOCATE(field_buffer)
+      ALLOCATE(field_buffer(nx,ny,nz))
+    ENDIF
+
+    field_buffer(1:nx,1:ny,1:nz)=0.
+
+  END SUBROUTINE  init_field_bufferize         
+
+END MODULE field_bufferize
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90	(revision 8)
@@ -0,0 +1,123 @@
+MODULE mod_global_memory
+
+  INTERFACE allocate_global_memory
+    MODULE PROCEDURE Allocate_global_memory_r8,    &
+                     Allocate_global_memory_i8,    &
+                     Allocate_global_memory_r4,    &
+                     Allocate_global_memory_i4
+  END INTERFACE Allocate_global_memory
+  
+CONTAINS
+
+  SUBROUTINE Allocate_global_memory_r8(size,Pt)
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    REAL(kind=8),POINTER :: Pt(:)
+    INTEGER              :: size
+
+    POINTER (Pbuffer,MPI_Buffer(size))
+    REAL(kind=8) :: MPI_Buffer
+    INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 
+    INTEGER :: ierr
+    
+    BS=8*size
+    CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr)
+    CALL associate_buffer(MPI_Buffer,Pt)
+  
+  CONTAINS
+  
+    SUBROUTINE associate_buffer(MPI_buffer,Pt)
+    IMPLICIT NONE
+      REAL(kind=8),DIMENSION(:),target :: MPI_Buffer
+      REAL(kind=8),POINTER             :: Pt(:)
+      Pt=>MPI_buffer
+    END SUBROUTINE associate_buffer
+  
+  END SUBROUTINE Allocate_global_memory_r8
+
+
+
+  SUBROUTINE Allocate_global_memory_i8(size,Pt)
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER(kind=8),POINTER :: Pt(:)
+    INTEGER              :: size
+
+    POINTER (Pbuffer,MPI_Buffer(size))
+    INTEGER(kind=8) :: MPI_Buffer
+    INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 
+    INTEGER :: ierr
+    
+    BS=8*size
+    CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr)
+    CALL associate_buffer(MPI_Buffer,Pt)
+  
+  CONTAINS
+  
+    SUBROUTINE associate_buffer(MPI_buffer,Pt)
+    IMPLICIT NONE
+      INTEGER(kind=8),DIMENSION(:),target :: MPI_Buffer
+      INTEGER(kind=8),POINTER             :: Pt(:)
+      Pt=>MPI_buffer
+    END SUBROUTINE associate_buffer
+  
+  END SUBROUTINE Allocate_global_memory_i8
+  
+  
+  SUBROUTINE Allocate_global_memory_r4(size,Pt)
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    REAL(kind=4),POINTER :: Pt(:)
+    INTEGER              :: size
+
+    POINTER (Pbuffer,MPI_Buffer(size))
+    REAL(kind=4) :: MPI_Buffer
+    INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 
+    INTEGER :: ierr
+    
+    BS=4*size
+    CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr)
+    CALL associate_buffer(MPI_Buffer,Pt)
+  
+  CONTAINS
+  
+    SUBROUTINE associate_buffer(MPI_buffer,Pt)
+    IMPLICIT NONE
+      REAL(kind=4),DIMENSION(:),target :: MPI_Buffer
+      REAL(kind=4),POINTER             :: Pt(:)
+      Pt=>MPI_buffer
+    END SUBROUTINE associate_buffer
+  
+  END SUBROUTINE Allocate_global_memory_r4
+
+
+
+
+  SUBROUTINE Allocate_global_memory_i4(size,Pt)
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER(kind=4),POINTER :: Pt(:)
+    INTEGER              :: size
+
+    POINTER (Pbuffer,MPI_Buffer(size))
+    INTEGER(kind=4) :: MPI_Buffer
+    INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 
+    INTEGER :: ierr
+    
+    BS=4*size
+    CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr)
+    CALL associate_buffer(MPI_Buffer,Pt)
+  
+  CONTAINS
+  
+    SUBROUTINE associate_buffer(MPI_buffer,Pt)
+    IMPLICIT NONE
+      INTEGER(kind=4),DIMENSION(:),target :: MPI_Buffer
+      INTEGER(kind=4),POINTER             :: Pt(:)
+      Pt=>MPI_buffer
+    END SUBROUTINE associate_buffer
+  
+  END SUBROUTINE Allocate_global_memory_i4
+  
+  
+END MODULE mod_global_memory
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90	(revision 8)
@@ -0,0 +1,219 @@
+MODULE mod_interface_ioipsl
+
+  INTEGER,SAVE,PRIVATE  :: ini_timestep
+  REAL,SAVE,PRIVATE     :: zjulian
+  REAL,SAVE,PRIVATE     :: timestep 
+  INTEGER,SAVE,PRIVATE  :: timestep_nb
+  
+  INTEGER,PARAMETER     :: id_file=1
+
+
+CONTAINS
+
+  SUBROUTINE init_interface_ioipsl
+  USE xmlio
+  IMPLICIT NONE
+  
+    
+  END SUBROUTINE init_interface_ioipsl
+
+
+  SUBROUTINE set_time_parameters(ini_timestep0,zjulian0,timestep0)
+  IMPLICIT NONE
+    INTEGER :: ini_timestep0
+    REAL :: zjulian0, timestep0
+
+    timestep=timestep0
+    ini_timestep=ini_timestep0
+    zjulian=zjulian0
+
+  END SUBROUTINE set_time_parameters
+
+  SUBROUTINE Create_file_definition(nb_server,server_rank)
+  USE ioipsl
+  USE xmlio
+  IMPLICIT NONE
+    INTEGER,INTENT(IN)  :: nb_server
+    INTEGER,INTENT(IN)  :: server_rank
+    
+    TYPE(file_dep),POINTER :: pt_file_dep
+    TYPE(file),POINTER     :: pt_file
+    TYPE(field),POINTER    :: pt_field
+    TYPE(grid),POINTER     :: pt_grid
+    TYPE(axis),POINTER     :: pt_axis
+    TYPE(domain),POINTER   :: pt_domain
+
+    TYPE(sorted_list),POINTER :: axis_id
+    LOGICAL :: found                  
+    INTEGER :: ioipsl_axis_id
+    INTEGER :: ioipsl_file_id
+    INTEGER :: ioipsl_hori_id
+    INTEGER :: ioipsl_domain_id
+    INTEGER :: i,j
+     
+    CALL xmlio__close_definition 
+    
+    ALLOCATE(axis_id)
+    
+    DO i=1,file_enabled%size
+      CALL sorted_list__new(axis_id)
+      
+      pt_file_dep=>file_enabled%at(i)%pt
+      pt_file=>pt_file_dep%file
+      
+      pt_grid=>pt_file_dep%grids%at(1)%pt
+      pt_domain=>pt_grid%domain
+      CALL set_ioipsl_domain_id(pt_grid,nb_server,server_rank,ioipsl_domain_id)
+      CALL histbeg(TRIM(pt_file%name),pt_domain%ni,pt_domain%lon, pt_domain%nj, pt_domain%lat,  &
+                    1, pt_domain%ni, 1, pt_domain%nj,ini_timestep, zjulian, timestep,           &
+                   ioipsl_hori_id, ioipsl_file_id,domain_id=ioipsl_domain_id)                                              
+      
+      DO j=1,pt_file_dep%axis%size
+        pt_axis=>pt_file_dep%axis%at(j)%pt
+        CALL sorted_list__find(axis_id,hash(Pt_axis%name),ioipsl_axis_id,found)
+        IF (.NOT. found) THEN
+          IF (TRIM(pt_axis%name) /= "none") THEN
+            CALL histvert(ioipsl_file_id, TRIM(pt_axis%name),TRIM(pt_axis%description),    &
+                         TRIM(pt_axis%unit), pt_axis%size,pt_axis%values, ioipsl_axis_id)
+            CALL sorted_list__add(axis_id,hash(Pt_axis%name),ioipsl_axis_id)
+          ENDIF
+        ENDIF
+      ENDDO
+      
+      DO j=1,pt_file_dep%fields%size
+        pt_field=>pt_file_dep%fields%at(j)%pt
+        IF (pt_field%axis%name=="none") THEN
+          pt_field%internal(id_file)=ioipsl_file_id
+          CALL histdef(ioipsl_file_id, TRIM(pt_field%name), pt_field%description,            &
+                    &  pt_field%unit, pt_field%grid%domain%ni, pt_field%grid%domain%nj,      &
+                    &  ioipsl_hori_id, 1, 1, 1, -99, 32, pt_field%operation,                 &
+                    &  real(pt_field%freq_op), real(pt_file%output_freq) )
+        ELSE
+          pt_field%internal(id_file)=ioipsl_file_id
+          CALL sorted_list__find(axis_id,hash(Pt_field%axis%name),ioipsl_axis_id,found)
+          CALL histdef(ioipsl_file_id, TRIM(pt_field%name), pt_field%description,          &
+                     & pt_field%unit, pt_field%grid%domain%ni, pt_field%grid%domain%nj,    &
+                     & ioipsl_hori_id, pt_field%axis%size, 1, pt_field%axis%size,          &
+                     & ioipsl_axis_id, 32, pt_field%operation, real(pt_field%freq_op),     &
+                     & real(pt_file%output_freq) )
+        ENDIF
+      ENDDO
+      CALL histend(ioipsl_file_id)
+      CALL sorted_list__delete(axis_id)
+    ENDDO
+    
+    DEALLOCATE(axis_id)
+     
+  END SUBROUTINE Create_file_definition  
+
+
+
+   SUBROUTINE write_ioipsl_2d(varname,var)
+   USE ioipsl
+   USE xmlio
+   IMPLICIT NONE
+     CHARACTER(len=*),INTENT(IN) :: varname
+     REAL            ,INTENT(IN) :: var(:,:)
+     
+     TYPE(field_dep),POINTER :: pt_field_base
+     TYPE(field)    ,POINTER :: pt_field
+     INTEGER :: nindex(size(var))
+     INTEGER :: ioipsl_file_id
+     INTEGER :: pos
+     LOGICAL :: found
+     INTEGER :: i
+      
+     CALL sorted_list__find(sorted_id,hash(varname),pos,found)
+     IF (found) THEN
+       pt_field_base=>field_id%at(pos)%pt
+     
+       DO i=1,pt_field_base%field_out%size
+         pt_field=>pt_field_base%field_out%at(i)%pt%field
+         ioipsl_file_id=pt_field%internal(id_file)
+         CALL histwrite(ioipsl_file_id, TRIM(pt_field%name), timestep_nb, var, size(var), nindex)
+       ENDDO
+     ENDIF
+     
+   END SUBROUTINE write_ioipsl_2d
+       
+     
+   SUBROUTINE write_ioipsl_3d(varname,var)
+   USE ioipsl
+   USE xmlio
+   IMPLICIT NONE
+     CHARACTER(len=*),INTENT(IN) :: varname
+     REAL            ,INTENT(IN) :: var(:,:,:)
+     
+     TYPE(field_dep),POINTER :: pt_field_base
+     TYPE(field)    ,POINTER :: pt_field
+     INTEGER :: nindex(size(var))
+     INTEGER :: ioipsl_file_id
+     INTEGER :: pos
+     LOGICAL :: found
+     INTEGER :: i
+        
+     CALL sorted_list__find(sorted_id,hash(varname),pos,found)
+     pt_field_base=>field_id%at(pos)%pt
+     
+     DO i=1,pt_field_base%field_out%size
+       pt_field=>pt_field_base%field_out%at(i)%pt%field
+       ioipsl_file_id=pt_field%internal(id_file)
+       CALL histwrite(ioipsl_file_id, TRIM(pt_field%name), timestep_nb, var, size(var), nindex)
+     ENDDO
+     
+   END SUBROUTINE write_ioipsl_3d
+           
+
+  SUBROUTINE set_timestep(timestep_nb0)
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: timestep_nb0
+     
+    timestep_nb=timestep_nb0
+
+  END SUBROUTINE set_timestep
+
+
+  SUBROUTINE set_ioipsl_domain_id(pt_grid, nb_server,server_rank,domain_id)
+  USE xmlio
+  USE mod_ioserver_para
+  USE ioipsl
+  IMPLICIT NONE
+    TYPE(grid), POINTER :: pt_grid
+    INTEGER,INTENT(IN)  :: nb_server
+    INTEGER,INTENT(IN)  :: server_rank
+    INTEGER,INTENT(OUT) :: domain_id
+    TYPE(domain), POINTER :: pt_domain
+               
+    INTEGER,DIMENSION(2) :: ddid
+    INTEGER,DIMENSION(2) :: dsg
+    INTEGER,DIMENSION(2) :: dsl
+    INTEGER,DIMENSION(2) :: dpf
+    INTEGER,DIMENSION(2) :: dpl
+    INTEGER,DIMENSION(2) :: dhs
+    INTEGER,DIMENSION(2) :: dhe 
+    
+    pt_domain=>pt_grid%domain
+
+    ddid = (/ 1,2 /)
+    dsg  = (/ pt_grid%ni, pt_grid%nj /)
+    dsl  = (/ pt_domain%ni, pt_domain%nj /)
+    dpf  = (/ pt_domain%ibegin,pt_domain%jbegin /)
+    dpl  = (/ pt_domain%iend, pt_domain%jend /)
+    dhs  = (/ 0,0 /)
+    dhe  = (/ 0,0 /)
+    
+    call flio_dom_set(nb_server,server_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
+                      'BOX',domain_id)
+  
+  END SUBROUTINE set_ioipsl_domain_id
+
+
+  SUBROUTINE ioipsl_finalize
+  USE ioipsl
+  IMPLICIT NONE
+
+    CALL histclo
+    
+  END SUBROUTINE ioipsl_finalize
+  
+END MODULE mod_interface_ioipsl
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient.f90	(revision 8)
@@ -0,0 +1,21 @@
+MODULE mod_ioclient
+
+
+CONTAINS
+
+  SUBROUTINE init_ioclient(NEW_COMM)
+  USE mod_ioclient_para
+  USE mod_mpi_buffer_client
+  USE mod_wait
+  IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: NEW_COMM
+    
+    CALL Init_parallel
+    CALL Init_mpi_buffer
+    CALL Init_wait
+    
+    NEW_COMM=intracomm
+    
+  END SUBROUTINE init_ioclient
+
+END MODULE mod_ioclient
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient_para.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient_para.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_ioclient_para.f90	(revision 8)
@@ -0,0 +1,77 @@
+  MODULE mod_ioclient_para
+    INTEGER,PARAMETER :: color_client=1
+    INTEGER,PARAMETER :: color_server=2 
+    INTEGER,SAVE      :: iocomm
+    INTEGER,SAVE      :: iosize
+    INTEGER,SAVE      :: iorank
+    INTEGER,SAVE      :: server_rank
+    INTEGER,SAVE      :: intracomm 
+  CONTAINS
+  
+  
+  SUBROUTINE Init_parallel
+  USE mpitrace
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER :: NEW_COMM
+    INTEGER :: ierr
+    INTEGER :: global_rank
+    INTEGER :: global_size
+    INTEGER :: mpi_rank
+    INTEGER :: mpi_size
+    INTEGER :: nb_server_io  
+    INTEGER,ALLOCATABLE :: proc_color(:) 
+    INTEGER :: i
+    INTEGER :: div,remain
+    INTEGER :: group_color
+    
+!    PRINT *, "on rentre dans MPI_INIT"
+    CALL MPI_INIT(ierr)
+    CALL MPI_COMM_RANK(MPI_COMM_WORLD,global_rank,ierr)
+    CALL MPI_COMM_SIZE(MPI_COMM_WORLD,global_size,ierr)
+    
+    PRINT *,"MPI_init Ok, --> mpi_comm_split"
+    CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,color_client,global_rank,intracomm,ierr)
+    CALL MPI_COMM_SIZE(intracomm,mpi_size,ierr)
+    CALL MPI_COMM_RANK(intracomm,mpi_rank,ierr)
+    PRINT *,"MPI_mpi_comm_split ok --> intracomm" 
+    nb_server_io=global_size-mpi_size
+    div=mpi_size/nb_server_io
+    remain=MOD(mpi_size,nb_server_io)
+    
+    IF (mpi_rank<remain*(div+1)) THEN
+      group_color=mpi_rank/(div+1)
+    ELSE
+      group_color=(nb_server_io-1)-(mpi_size-1-mpi_rank)/div
+    ENDIF
+    PRINT *,'group_color',group_color
+
+    CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,group_color,global_rank,iocomm,ierr)
+    
+    CALL MPI_COMM_SIZE(iocomm,iosize,ierr)
+    CALL MPI_COMM_RANK(iocomm,iorank,ierr)
+    PRINT *,"io_size-> ",iosize,"iorank-> ",iorank
+    ALLOCATE(proc_color(0:iosize-1))
+    CALL MPI_ALLGATHER(color_client,1,MPI_INTEGER,proc_color,1,MPI_INTEGER,iocomm,ierr)
+    print *,"proc_color -> ",proc_color
+    
+    DO i=0,iosize-1
+      IF (proc_color(i)==color_server) THEN
+        server_rank=i
+        EXIT
+      ENDIF
+    ENDDO
+    
+    PRINT *,"Proces No",mpi_rank,"--> server",server_rank
+  END SUBROUTINE Init_parallel
+  
+  SUBROUTINE Finalize_parallel
+  IMPLICIT NONE
+    include 'mpif.h'
+    INTEGER :: ierr
+    
+    CALL MPI_FINALIZE(ierr)
+
+  END SUBROUTINE Finalize_parallel
+  
+  END MODULE mod_ioclient_para
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_iomanager.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_iomanager.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_iomanager.f90	(revision 8)
@@ -0,0 +1,357 @@
+MODULE iomanager
+  INTEGER,PRIVATE,SAVE :: nb_client
+  INTEGER,PRIVATE,SAVE :: nb_server
+  INTEGER,PRIVATE,SAVE :: server_rank
+  INTEGER,PRIVATE,SAVE :: current_rank
+  
+CONTAINS
+
+  SUBROUTINE iom__init(nb_client_,nb_server_,server_rank_)
+  IMPLICIT NONE
+   INTEGER,INTENT(IN) :: nb_client_
+   INTEGER,INTENT(IN) :: nb_server_
+   INTEGER,INTENT(IN) :: server_rank_
+   
+     nb_client=nb_client_ 
+     nb_server=nb_server_
+     server_rank=server_rank_
+     
+  END SUBROUTINE iom__init
+ 
+  SUBROUTINE iom__parse_xml_file(filename)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: filename
+    
+    IF (current_rank==nb_client) CALL xmlio__init(filename)
+     
+  END SUBROUTINE iom__parse_xml_file
+   
+  SUBROUTINE iom__set_current_rank(rank)
+  IMPLICIT NONE
+    INTEGER,INTENT(IN) :: rank
+    
+    current_rank=rank
+  
+  END SUBROUTINE iom__set_current_rank
+  
+  SUBROUTINE iom__set_vert_axis(name,vert_value)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    REAL,INTENT(IN)             :: vert_value(:)
+    TYPE(axis), POINTER :: pt_axis
+    
+    IF (current_rank==nb_client) THEN
+      CALL axis__get(name, pt_axis)
+      CALL axis__set(pt_axis, a_size=size(vert_value), values=vert_value)
+    ENDIF
+ 
+  END SUBROUTINE iom__set_vert_axis
+
+ 
+  SUBROUTINE iom__set_grid_dimension(name,ni_glo,nj_glo)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    INTEGER,INTENT(IN) :: ni_glo
+    INTEGER,INTENT(IN) :: nj_glo
+    TYPE(grid), POINTER :: pt_grid
+  
+    IF (current_rank==nb_client) THEN
+      CALL grid__get(name,pt_grid)
+      CALL grid__set_dimension(pt_grid,ni_glo,nj_glo)
+    ENDIF
+
+  END SUBROUTINE iom__set_grid_dimension
+  
+  SUBROUTINE iom__set_grid_domain(name,ni,nj,ibegin,jbegin,lon,lat)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+    INTEGER,INTENT(IN) :: ni
+    INTEGER,INTENT(IN) :: nj
+    INTEGER,INTENT(IN) :: ibegin
+    INTEGER,INTENT(IN) :: jbegin
+    REAL,INTENT(IN)    :: lon(ni,nj)
+    REAL,INTENT(IN)    :: lat(ni,nj)
+
+    TYPE(grid),   POINTER :: pt_grid
+    TYPE(domain), POINTER :: pt_domain
+
+      CALL grid__get(name,pt_grid)
+      CALL grid__get_new_subdomain(pt_grid,current_rank,pt_domain)
+      CALL domain__set(pt_domain,current_rank,ni,nj,ibegin,jbegin,lon,lat)
+
+  END SUBROUTINE iom__set_grid_domain
+
+  SUBROUTINE iom__set_grid_type_nemo(name)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: name
+
+    TYPE(grid),   POINTER :: pt_grid
+    TYPE(domain), POINTER :: pt_domain
+      
+      CALL grid__get(name,pt_grid)
+      CALL grid__get_subdomain(pt_grid,current_rank,pt_domain)
+      CALL domain__set_type_box(pt_domain)
+
+  END SUBROUTINE iom__set_grid_type_nemo
+      
+  SUBROUTINE iom__set_time_parameters(itau0,zjulian,zdt)
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+    INTEGER, INTENT(IN) :: itau0
+    REAL,INTENT(IN)     :: zjulian
+    REAL,INTENT(IN)     :: zdt
+      
+    IF (current_rank==nb_client) THEN
+      CALL set_time_parameters(itau0, zjulian, zdt)
+    ENDIF
+  END SUBROUTINE iom__set_time_parameters
+  
+  SUBROUTINE iom__close_io_definition
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+  
+    IF (current_rank==nb_client) CALL Create_file_definition(nb_server,server_rank)
+  
+  END SUBROUTINE iom__close_io_definition
+      
+
+  SUBROUTINE iom__set_timestep(timestep)
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+    INTEGER, INTENT(IN) :: timestep
+    
+    IF (current_rank==nb_client) CALL set_timestep(timestep)
+    
+  END SUBROUTINE iom__set_timestep
+
+  SUBROUTINE iom__enable_field(varname)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: varname
+    TYPE(field),POINTER :: pt_field
+    
+    CALL field__get(TRIM(varname), pt_field)
+    CALL field__set(pt_field,enabled=.TRUE.)
+    
+  END SUBROUTINE iom__enable_field
+  
+  SUBROUTINE iom__disable_field(varname)
+  USE xmlio
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: varname
+    TYPE(field),POINTER :: pt_field
+    
+    CALL field__get(TRIM(varname), pt_field)
+    CALL field__set(pt_field,enabled=.FALSE.)
+    
+  END SUBROUTINE iom__disable_field
+   
+
+  SUBROUTINE iom__write_field1d(varname,var)
+  USE xmlio
+  USE field_bufferize
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: varname
+    REAL             :: var(:)
+
+    TYPE(field),POINTER  :: pt_field
+    TYPE(domain),POINTER :: subdomain
+    TYPE(domain),POINTER :: local_domain
+    INTEGER :: ni,nj,ibegin,jbegin
+    INTEGER :: id_rank
+    
+    CALL field__get(varname,pt_field)
+    id_rank=pt_field%grid%ranks(current_rank)
+    local_domain=>pt_field%grid%domain
+    
+    subdomain=>pt_field%grid%subdomain%at(id_rank)%pt
+    ni=subdomain%ni
+    nj=subdomain%nj
+    ibegin=subdomain%ibegin-local_domain%ibegin+1
+    jbegin=subdomain%jbegin-local_domain%jbegin+1 
+
+    IF (subdomain%type==box) THEN
+
+      WRITE(message,*) 'Field must have 2 or 3 dimensions for box domain. There, it have only one.' 
+      CALL error("iom__write_field2d")
+
+    ELSE IF (subdomain%type==orange) THEN
+      IF (size(var,1)/=subdomain%nbp) THEN 
+         WRITE(message,*) 'Field dimensions are not compliant with the associated grid ',  &
+                          'field nbp :',size(var,1),'   grid nbp :',subdomain%nbp
+         CALL error("iom__write_field2d")
+      ENDIF
+      IF (pt_field%axis%name /= 'none') THEN
+        WRITE(message,*) "Missing axis dimension for this field"
+        CALL error("iom__write_field2d")
+      ENDIF
+    ENDIF
+    
+    
+    IF (current_rank==1) THEN
+      CALL init_field_bufferize(local_domain%ni,local_domain%nj,1)
+    ENDIF
+    
+    CALL bufferize_field(ni,ibegin,nj,jbegin,1,1,subdomain%nbp,var,         &
+                         subdomain%i_index,subdomain%j_index,subdomain%mask)
+    
+    IF (current_rank==nb_client) THEN
+      ni=local_domain%ni
+      nj=local_domain%nj
+      CALL write_ioipsl_2d(varname,Field_buffer(1:ni,1:nj,1))
+    ENDIF
+    
+  END SUBROUTINE iom__write_field1d
+
+   
+  SUBROUTINE iom__write_field2d(varname,var)
+  USE xmlio
+  USE field_bufferize
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: varname
+    REAL             :: var(:,:)
+
+    TYPE(field),POINTER  :: pt_field
+    TYPE(domain),POINTER :: subdomain
+    TYPE(domain),POINTER :: local_domain
+    INTEGER :: ni,nj,nk,ibegin,jbegin
+    INTEGER :: id_rank
+    
+    CALL field__get(varname,pt_field)
+    id_rank=pt_field%grid%ranks(current_rank)
+    local_domain=>pt_field%grid%domain
+    
+    subdomain=>pt_field%grid%subdomain%at(id_rank)%pt
+    ni=subdomain%ni
+    nj=subdomain%nj
+    ibegin=subdomain%ibegin-local_domain%ibegin+1
+    jbegin=subdomain%jbegin-local_domain%jbegin+1 
+    nk=pt_field%axis%size
+
+    IF (subdomain%type==box) THEN
+      IF (size(var,1)/=ni .OR. size(var,2)/=nj) THEN
+        WRITE(message,*) 'Field dimensions are not compliant with the associated grid ',  &
+                          'field dim :',size(var,1),',',size(var,2),'   grid dim',ni,',',nj
+        CALL error("iom__write_field2d")
+      ENDIF
+      
+      IF (pt_field%axis%name/="none") THEN
+        WRITE(message,*) "Missing axis dimension for this field"
+        CALL error("iom__write_field2d")
+      ENDIF
+    
+    ELSE IF (subdomain%type==orange) THEN
+      IF (size(var,1)/=subdomain%nbp) THEN 
+         WRITE(message,*) 'Field dimensions are not compliant with the associated grid ',  &
+                          'field nbp :',size(var,1),'   grid nbp : ',subdomain%nbp
+         CALL error("iom__write_field2d")
+      ENDIF
+      IF (nk /= size(var,2)) THEN
+         WRITE(message,*) 'Field dimensions are not compliant with the associated axis', &
+                          'field dim :',size(var,2),'   axis dim :', nk
+         CALL error("iom__write_field2d")
+      ENDIF
+    ENDIF
+    
+    
+    IF (current_rank==1) THEN
+      CALL init_field_bufferize(local_domain%ni,local_domain%nj,nk)
+    ENDIF
+    
+    CALL bufferize_field(ni,ibegin,nj,jbegin,nk,1,subdomain%nbp,var,         &
+                         subdomain%i_index,subdomain%j_index,subdomain%mask)
+    
+    IF (current_rank==nb_client) THEN
+      ni=local_domain%ni
+      nj=local_domain%nj
+      
+      IF (pt_field%axis%name/="none") THEN
+        CALL write_ioipsl_2d(varname,Field_buffer(1:ni,1:nj,1))
+      ELSE 
+        CALL write_ioipsl_3d(varname,Field_buffer(1:ni,1:nj,1:nk))
+      ENDIF
+    
+    ENDIF
+    
+  END SUBROUTINE iom__write_field2d
+
+  SUBROUTINE iom__write_field3d(varname,var)
+  USE xmlio
+  USE field_bufferize
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+    CHARACTER(LEN=*) :: varname
+    REAL             :: var(:,:,:)
+
+    TYPE(field),POINTER  :: pt_field
+    TYPE(domain),POINTER :: subdomain
+    TYPE(domain),POINTER :: local_domain
+    INTEGER :: ni,nj,nk,ibegin,jbegin
+    INTEGER :: id_rank
+    
+    CALL field__get(varname,pt_field)
+    id_rank=pt_field%grid%ranks(current_rank)
+    local_domain=>pt_field%grid%domain
+    
+    subdomain=>pt_field%grid%subdomain%at(id_rank)%pt
+    ni=subdomain%ni
+    nj=subdomain%nj
+    ibegin=subdomain%ibegin-local_domain%ibegin+1
+    jbegin=subdomain%jbegin-local_domain%jbegin+1 
+    nk=pt_field%axis%size
+
+    IF (subdomain%type==box) THEN
+      IF (size(var,1)/=ni .OR. size(var,2)/=nj) THEN
+        WRITE(message,*) 'Field dimensions are not compliant with the associated grid ',  &
+                          'field dim :',size(var,1),',',size(var,2),'   grid dim',ni,',',nj
+        CALL error("iom__write_field3d")
+      ENDIF
+      
+      IF (pt_field%axis%name=='none' .OR. nk/=size(var,3)) THEN
+        WRITE(message,*) 'Field dimension is not compliant with the associated axis : ', &
+                         'field dim : ',size(var,3),'  axis dim : ',nk
+        CALL error("iom__write_field3d")
+      ENDIF
+
+    ELSE IF (subdomain%type==orange) THEN
+
+      WRITE(message,*) 'Field have too much dimensions for box domain. There, it has 3.' 
+      CALL error("iom__write_field3d")
+      
+    ENDIF
+    
+    
+    IF (current_rank==1) THEN
+      CALL init_field_bufferize(local_domain%ni,local_domain%nj,nk)
+    ENDIF
+    
+    CALL bufferize_field(ni,ibegin,nj,jbegin,nk,1,subdomain%nbp,var,         &
+                         subdomain%i_index,subdomain%j_index,subdomain%mask)
+    
+    IF (current_rank==nb_client) THEN
+      ni=local_domain%ni
+      nj=local_domain%nj
+      
+      CALL write_ioipsl_3d(varname,Field_buffer(1:ni,1:nj,1:nk))
+    
+    ENDIF
+    
+  END SUBROUTINE iom__write_field3d
+ 
+  SUBROUTINE iom__Finalize
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+  
+    IF (current_rank==nb_client) CALL ioipsl_finalize
+    
+  END SUBROUTINE iom__Finalize
+ 
+END MODULE iomanager 
+ 
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_ioserver_para.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_ioserver_para.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_ioserver_para.f90	(revision 8)
@@ -0,0 +1,74 @@
+  MODULE mod_ioserver_para
+    INTEGER,PARAMETER :: color_client=1
+    INTEGER,PARAMETER :: color_server=2 
+
+    INTEGER,SAVE      :: iocomm
+    INTEGER,SAVE      :: iosize
+    INTEGER,SAVE      :: iorank
+    
+    INTEGER,SAVE      :: mpi_rank
+    INTEGER,SAVE      :: mpi_size
+    INTEGER,SAVE      :: mpi_master
+    LOGICAL,SAVE      :: is_mpi_master
+  
+    INTEGER,SAVE      :: nb_client
+    INTEGER,ALLOCATABLE,SAVE      :: client_rank(:)
+    INTEGER,SAVE      :: intracomm 
+  CONTAINS
+  
+  
+  SUBROUTINE Init_parallel
+  USE mpitrace
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER :: ierr
+    INTEGER :: global_rank
+    INTEGER :: global_size
+    INTEGER,ALLOCATABLE :: proc_color(:)
+    INTEGER :: i
+    INTEGER :: group_color
+    
+    CALL MPI_INIT(ierr)
+    CALL MPI_COMM_RANK(MPI_COMM_WORLD,global_rank,ierr)
+    CALL MPI_COMM_SIZE(MPI_COMM_WORLD,global_size,ierr)
+   
+    CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,color_server,global_rank,intracomm,ierr)
+    CALL MPI_COMM_SIZE(intracomm,mpi_size,ierr)
+    CALL MPI_COMM_RANK(intracomm,mpi_rank,ierr)
+    
+    group_color=mpi_rank
+    PRINT *,'group_color',group_color
+
+    CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,group_color,global_rank,iocomm,ierr)    
+    
+    CALL MPI_COMM_SIZE(iocomm,iosize,ierr)
+    CALL MPI_COMM_RANK(iocomm,iorank,ierr)
+
+    PRINT *,"io_size-> ",iosize,"iorank-> ",iorank
+    
+    ALLOCATE(proc_color(0:iosize-1))
+    CALL MPI_ALLGATHER(color_server,1,MPI_INTEGER,proc_color,1,MPI_INTEGER,iocomm,ierr)
+    print *,"proc_color -> ",proc_color
+    
+    ALLOCATE(client_rank(iosize-1))
+    nb_client=0
+    DO i=0,iosize-1
+      IF (proc_color(i)==color_client) THEN
+        nb_client=nb_client+1
+        client_rank(nb_client)=i
+      ENDIF
+    ENDDO
+
+    PRINT *,"Proces No",mpi_rank,"--> client ",client_rank
+  END SUBROUTINE Init_parallel
+  
+  SUBROUTINE Finalize_parallel
+  IMPLICIT NONE
+    include 'mpif.h'
+    INTEGER :: ierr
+    
+    CALL MPI_FINALIZE(ierr)
+
+  END SUBROUTINE Finalize_parallel
+
+END MODULE mod_ioserver_para
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90	(revision 8)
@@ -0,0 +1,188 @@
+MODULE mod_mpi_buffer_client
+  USE mod_mpi_buffer_parameters
+  USE mpi, ONLY : status_size=>MPI_STATUS_SIZE
+  
+  INTEGER(KIND=8),POINTER :: MPI_Buffer(:)
+  
+  TYPE mpi_requests
+    INTEGER :: request
+    INTEGER :: status(status_size)
+    INTEGER :: Pos
+  END TYPE mpi_requests
+  
+  TYPE(mpi_requests),DIMENSION(max_request) :: pending_request
+  
+  INTEGER :: Buffer_pos
+  INTEGER :: request_pos
+  INTEGER :: buffer_begin
+  INTEGER :: request_begin
+  INTEGER :: nb_request_pending
+  INTEGER,SAVE :: start_pos
+  LOGICAL,SAVE :: ok_new_request
+  
+CONTAINS
+
+  SUBROUTINE Init_mpi_buffer
+  USE mod_global_memory
+  USE mod_pack
+  IMPLICIT NONE
+  
+    CALL allocate_global_memory(mpi_buffer_size,MPI_Buffer)
+    buffer_begin=1
+    request_begin=1
+    Buffer_pos=1
+    nb_request_pending=0
+    Request_pos=1
+    ok_new_request=.TRUE.
+    CALL set_pack_buffer(MPI_Buffer,buffer_begin)
+    
+  END SUBROUTINE Init_mpi_buffer
+  
+
+  SUBROUTINE create_request(request_id)
+  USE mod_pack
+  USE mod_ioclient_para
+  USE mpitrace
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER :: request_id
+    
+    CALL VTb(VTprocess_event)
+    IF (ok_new_request) THEN  
+      Pending_request(Request_pos)%Pos = pack_pos
+      ok_new_request=.FALSE.
+    ENDIF
+    start_pos=pack_pos
+    pack_pos=pack_pos+1
+!    PRINT *,"Pos in Buffer",Pending_request(Request_pos)%Pos,"pack_pos",pack_pos
+    CALL pack(request_id)
+
+  END SUBROUTINE create_request
+  
+  
+  SUBROUTINE Finalize_request
+  USE mod_pack
+  USE mod_ioclient_para
+  USE mpitrace
+  use mod_wait
+  IMPLICIT NONE
+    INCLUDE 'mpif.h'
+    INTEGER :: ierr
+    INTEGER :: message_size
+    INTEGER(KIND=8) :: request_size
+    INTEGER :: buffer_free
+    LOGICAL :: ok_out
+    LOGICAL :: is_Buffer_full
+    request_size=pack_pos-start_pos    
+    pack_buffer(start_pos)=request_size
+    message_size=pack_pos-Pending_request(Request_pos)%Pos
+
+
+!! ICI verifier que le buffer ne se recouvre pas ainsi que les requetes
+    
+    ok_out=.FALSE.
+    is_buffer_full=.FALSE.
+    DO WHILE (.NOT. ok_out)
+      CALL check_request
+    
+      IF ( buffer_begin <= pack_pos) THEN
+        Buffer_free=mpi_buffer_size-pack_pos+1
+      ELSE
+        Buffer_free=buffer_begin-pack_pos
+      ENDIF
+      
+!      Print *,"message_size",message_size,"buffer_free",buffer_free
+!      PRINT *,"Request_pos",request_pos
+!      PRINT *,"Pos in Buffer",Pending_request(Request_pos)%Pos,"pack_pos",pack_pos
+      IF ( nb_request_pending==1 .AND. (buffer_free < MPI_buffer_size * 0.4) ) THEN
+        ok_out=.FALSE.
+        CALL Wait_us(10)
+        IF (.NOT. is_buffer_full) THEN
+          CALL VTb(VTbuffer_full)
+        ENDIF      
+        is_Buffer_full=.TRUE.
+        
+      ELSE
+        ok_out=.TRUE.
+        IF (is_buffer_full) THEN
+          CALL VTe(VTbuffer_full)
+        ENDIF
+        is_buffer_full=.FALSE.
+      
+      ENDIF
+      
+   ENDDO
+   
+   IF (nb_request_pending==0 .OR. (buffer_free < MPI_buffer_size* 0.4 )) THEN
+      
+     CALL MPI_ISSEND(MPI_Buffer(Pending_request(Request_pos)%Pos),message_size,MPI_INTEGER8,     &
+                    server_rank,tag_iocomm,iocomm,Pending_request(Request_pos)%request,ierr )
+    
+!    PRINT *,"Requete envoyée !!!!" 
+!    PRINT *,"Message : ",MPI_Buffer(Pending_request(Request_pos)%Pos:Pending_request(Request_pos)%Pos+message_size-1)              
+      IF ( Pack_Pos > MPI_buffer_size*0.6 ) THEN
+        Pack_Pos=1
+      ENDIF
+    
+      IF (Request_Pos==max_request) THEN
+        Request_Pos=1
+      ELSE 
+        Request_Pos=Request_Pos+1
+      ENDIF
+      nb_request_pending=nb_request_pending+1
+    
+      ok_new_request=.TRUE.
+   
+    ENDIF
+    CALL VTe(VTprocess_event)    
+  END SUBROUTINE Finalize_request
+
+
+  SUBROUTINE Check_request
+  IMPLICIT NONE
+  INCLUDE 'mpif.h'
+  LOGICAL :: ok_out
+  LOGICAL :: OK_complete
+  INTEGER :: ierr
+  
+!    PRINT *, 'on entre dans Check_request'
+!    PRINT *, 'nb_request_pending',nb_request_pending
+    
+    IF (nb_request_pending>0) THEN
+      ok_out=.FALSE.
+    ELSE
+      ok_out=.TRUE.
+    ENDIF
+    
+    DO WHILE (.NOT. ok_out)
+    
+!      PRINT *,'Testing_request...'
+!      PRINT *,'request_begin',request_begin
+      CALL MPI_TEST(Pending_request(request_begin)%request,ok_complete,Pending_request(request_begin)%status,ierr)
+!      PRINT *,'Request has been tested...'
+      IF (ok_complete) THEN
+!        PRINT *,"Request_completed"
+        IF (Request_begin==max_request) THEN
+          Request_begin=1
+        ELSE
+          request_begin=request_begin+1
+        ENDIF
+        
+        buffer_begin=Pending_request(request_begin)%Pos
+        
+        nb_request_pending=nb_request_pending-1
+        
+        IF (nb_request_pending==0) THEN 
+          ok_out=.TRUE.
+        ELSE
+          ok_out=.FALSE.
+        ENDIF
+      ELSE
+        ok_out=.TRUE.
+      ENDIF
+    
+    ENDDO
+!    PRINT *, 'on sort de Check_request'  
+  END SUBROUTINE Check_Request
+
+END MODULE mod_mpi_buffer_client
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_parameters.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_parameters.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_parameters.f90	(revision 8)
@@ -0,0 +1,7 @@
+MODULE mod_mpi_buffer_parameters
+  INTEGER,PARAMETER :: mpi_buffer_size = 1024*1024*64
+  INTEGER,PARAMETER :: max_request = 10000
+  REAL, PARAMETER   :: frac_alert  = 0.9
+  INTEGER           :: tag_iocomm  = 4000
+  INTEGER           :: tag_terminate = 4001
+END MODULE mod_mpi_buffer_parameters
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_server.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_server.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_server.f90	(revision 8)
@@ -0,0 +1,262 @@
+MODULE mod_mpi_buffer_server
+  USE mod_mpi_buffer_parameters
+
+  TYPE mpi_requests
+    INTEGER :: Pos
+    INTEGER :: size
+  END TYPE mpi_requests
+  
+  TYPE buffer
+    INTEGER(KIND=8),POINTER  :: mpi_buffer(:)
+    INTEGER :: pos
+    INTEGER :: begin
+    TYPE(mpi_requests),POINTER :: request(:)
+    INTEGER :: request_pos
+    INTEGER :: nb_request
+    INTEGER :: request_begin
+    INTEGER :: request_free
+    LOGICAL :: is_posted
+    LOGICAL :: is_terminated
+    INTEGER :: last_request
+  END TYPE buffer
+
+  TYPE(buffer),ALLOCATABLE,SAVE :: buffers(:)
+  
+  INTEGER,SAVE :: current_rank
+  
+  
+CONTAINS
+  
+  SUBROUTINE Init_mpi_buffer
+  USE mod_ioserver_para
+  USE mod_global_memory
+  IMPLICIT NONE
+    INTEGER :: n
+    
+    ALLOCATE(buffers(nb_client))
+    
+    DO n=1,nb_client
+      CALL allocate_global_memory(mpi_buffer_size,buffers(n)%MPI_Buffer)
+      buffers(n)%pos=1
+      buffers(n)%begin=1
+      ALLOCATE(buffers(n)%request(max_request))
+      buffers(n)%nb_request=0
+      buffers(n)%request_free=max_request
+      buffers(n)%request_pos=1
+      buffers(n)%request_begin=1
+      buffers(n)%is_posted=.FALSE.
+      buffers(n)%is_terminated=.FALSE.
+    ENDDO
+
+  END SUBROUTINE Init_mpi_buffer
+
+  SUBROUTINE Check_buffer
+  USE mod_ioserver_para
+  USE mpitrace
+  IMPLICIT NONE
+  INCLUDE 'mpif.h'
+    INTEGER :: n
+    INTEGER :: status(MPI_STATUS_SIZE)
+    LOGICAL :: ok_complete
+    LOGICAL :: ok_out
+    INTEGER :: ierr
+    INTEGER :: message_size
+    INTEGER :: Buffer_space 
+    INTEGER :: request
+    
+    CALL VTb(VTcheck_buffer)
+    DO n=1,nb_client
+      ok_out=.FALSE.
+      
+      DO WHILE (.NOT. ok_out)
+        
+        IF (buffers(n)%is_posted) THEN
+!          PRINT*,"MPI_TEST"
+!          PRINT *,"MPI_TEST LAST_REQUEST (avant)",buffers(n)%last_request,"ok_complete ?",ok_complete
+          CALL MPI_TEST(buffers(n)%last_request,ok_complete,status,ierr)
+!          PRINT *,"MPI_TEST LAST_REQUEST (apres)",buffers(n)%last_request,"ok_complete ?",ok_complete
+
+          IF (ok_complete) THEN
+            CALL MPI_GET_COUNT(status,MPI_INTEGER8,message_size,ierr)
+            CALL Fill_request(n,Buffers(n)%pos,message_size)
+            buffers(n)%is_posted=.FALSE.
+            buffers(n)%pos=buffers(n)%pos+message_size
+         
+!            PRINT *,"buffer_pos",buffers(n)%pos
+!            PRINT *,"Message recu de taille", message_size
+!              PRINT *,"Message : ",buffers(n)%mpi_buffer(buffers(n)%pos:buffers(n)%pos+message_size-1)
+!              PRINT *,"Nouvelle taille buffer_pos",buffers(n)%pos
+              ok_out=.FALSE.
+          ELSE
+              ok_out=.TRUE.
+          ENDIF
+       
+        ELSE  ! (.NOT. is_posted)        
+!          PRINT *,"MPI_IPROBE"
+     
+          CALL MPI_IPROBE(client_rank(n),tag_iocomm,iocomm,ok_complete,status,ierr)
+!          PRINT *,"Ok_complete.. ?",ok_complete
+          IF (ok_complete) THEN
+            CALL MPI_GET_COUNT(status,MPI_INTEGER8,message_size,ierr)
+!            PRINT *,"message_size",message_size
+            IF (buffers(n)%pos >= buffers(n)%begin) THEN
+              IF (buffers(n)%pos+message_size>mpi_buffer_size) THEN
+                buffer_space=buffers(n)%begin-1
+              ELSE
+                buffer_space=mpi_buffer_size-buffers(n)%begin+1
+              ENDIF
+            ELSE
+              buffer_space=buffers(n)%begin-buffers(n)%pos
+            ENDIF
+            
+            IF (buffer_space < message_size .OR. buffers(n)%request_free==0) THEN
+              ok_out=.TRUE.
+!              PRINT *,"BUFFER FULL !!!!"
+!              PRINT *,"buffer_space",buffer_space,"request_free",buffers(n)%request_free
+!              PRINT *,"buffer_pos",buffers(n)%pos,"buffer_begin",buffers(n)%begin
+            ELSE
+              
+              IF (buffers(n)%pos+message_size>mpi_buffer_size) buffers(n)%pos=1
+          
+!              PRINT *,'reception du message'
+              CALL MPI_IRECV(buffers(n)%mpi_buffer(buffers(n)%pos),message_size,MPI_INTEGER8,          &
+                          client_rank(n),tag_iocomm,iocomm,buffers(n)%last_request,ierr)
+                          
+              buffers(n)%is_posted=.TRUE.
+!              PRINT *,"MPI_IRECV LAST_REQUEST",buffers(n)%last_request
+              CALL MPI_TEST(buffers(n)%last_request,ok_complete,status,ierr)
+!              PRINT *,"MPI_TEST LAST_REQUEST",buffers(n)%last_request,"ok_complete ?",ok_complete
+              
+              IF (ok_complete) THEN
+                buffers(n)%is_posted=.FALSE.
+                CALL Fill_request(n,Buffers(n)%pos,message_size)
+
+                buffers(n)%pos=buffers(n)%pos+message_size
+                 
+!                PRINT *,"buffer_pos",buffers(n)%pos
+!                PRINT *,"Message recu de taille", message_size
+!                PRINT *,"Message : ",buffers(n)%mpi_buffer(buffers(n)%pos:buffers(n)%pos+message_size-1)
+!                PRINT *,"Nouvelle taille buffer_pos",buffers(n)%pos
+                ok_out=.FALSE.
+              ELSE
+                ok_out=.TRUE.
+              ENDIF
+         
+            ENDIF
+          ELSE
+            ok_out=.TRUE.
+          ENDIF
+        ENDIF  ! (is_posted)
+        ok_out=.TRUE.
+      ENDDO
+    ENDDO
+
+    CALL VTe(VTcheck_buffer)
+
+  END SUBROUTINE Check_buffer
+  
+  SUBROUTINE Fill_request(n,pos,message_size)
+  USE mpi
+  IMPLICIT NONE
+    INTEGER :: n
+    INTEGER :: pos
+    INTEGER :: message_size
+    INTEGER :: current_size
+    INTEGER :: current_pos
+    INTEGER :: total_size
+    LOGICAL :: ok_out
+    INTEGER :: ierr
+!    PRINT *,'Fill_request!!!'
+!    PRINT *,'Buffer_pos',pos
+!    PRINT *,"First integer",Buffers(n)%mpi_buffer(pos)
+    total_size=0
+    current_pos=pos
+    
+    ok_out=.FALSE.
+    DO WHILE (.NOT. ok_out)
+      
+      IF (Buffers(n)%request_free==0) THEN
+        PRINT *,'Plus de requete disponible !!!!'
+        CALL MPI_ABORT(MPI_COMM_WORLD,ierr)
+      ENDIF
+      
+      current_size=buffers(n)%mpi_buffer(current_pos)
+      Buffers(n)%request(Buffers(n)%request_pos)%pos=current_pos+1
+      Buffers(n)%request(Buffers(n)%request_pos)%size=current_size
+      total_size=total_size+current_size
+      
+      IF (Buffers(n)%request_pos==max_request) THEN 
+        Buffers(n)%request_pos=1
+      ELSE
+        Buffers(n)%request_pos=Buffers(n)%request_pos+1
+      ENDIF
+      Buffers(n)%request_free=Buffers(n)%request_free-1
+      Buffers(n)%nb_request=Buffers(n)%nb_request+1
+      
+      IF (total_size==message_size) ok_out=.TRUE.
+      IF (total_size>message_size) THEN
+        PRINT *,"Probleme : la taille du message ne coincide pas avec la taille de l'enveloppe"
+        CALL MPI_ABORT(MPI_COMM_WORLD,ierr)
+      ENDIF
+      
+      current_pos=current_pos+current_size
+    ENDDO
+  
+  END SUBROUTINE Fill_request 
+    
+  
+  SUBROUTINE Process_request(is_terminated)
+  USE mod_event_server
+  USE mod_ioserver_para
+  USE mod_pack
+  USE mpitrace
+  USE mod_wait
+  IMPLICIT NONE
+    LOGICAL  :: is_terminated
+    INTEGER  :: n
+    
+    is_terminated=.FALSE.
+    
+    IF (ALL(buffers(:)%nb_request>0)) THEN
+      DO n=1,nb_client
+!        PRINT *,"nb_request ?",buffers(n)%nb_request
+        IF ( (buffers(n)%nb_request > 0) .AND. (.NOT. buffers(n)%is_terminated)) THEN
+!          PRINT *,"request_pos",buffers(n)%request_begin
+!          PRINT *,"buffer_pos",buffers(n)%request(buffers(n)%request_begin)%pos
+          CALL set_pack_buffer(buffers(n)%mpi_buffer,buffers(n)%request(buffers(n)%request_begin)%pos)
+          CALL VTb(VTprocess_event)
+          current_rank=n
+          CALL process_event(n,buffers(n)%is_terminated)
+          CALL VTe(VTprocess_event)
+          buffers(n)%nb_request=buffers(n)%nb_request-1
+          buffers(n)%request_free=buffers(n)%request_free+1
+        
+       
+          IF (Buffers(n)%request_begin==max_request) THEN
+            Buffers(n)%request_begin=1
+          ELSE
+            buffers(n)%request_begin=Buffers(n)%request_begin+1
+          ENDIF
+          
+          IF (buffers(n)%nb_request > 0) THEN 
+            buffers(n)%begin=buffers(n)%request(buffers(n)%request_begin)%pos
+          ELSE
+            buffers(n)%begin=buffers(n)%pos
+          ENDIF
+        ENDIF
+      ENDDO 
+    
+!      PRINT *,"buffers_is_terminated",buffers(1:nb_client)%is_terminated
+!      PRINT *,"buffers_nb_request",buffers(1:nb_client)%nb_request
+      IF (ALL(buffers(1:nb_client)%is_terminated)) THEN
+        IF (ALL(buffers(1:nb_client)%nb_request==0)) THEN
+          is_terminated=.TRUE.
+        ENDIF
+      ENDIF
+    ELSE
+      CALL Wait_us(50)
+    ENDIF     
+  END SUBROUTINE process_request  
+  
+    
+END MODULE mod_mpi_buffer_server
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_pack.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_pack.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_pack.f90	(revision 8)
@@ -0,0 +1,468 @@
+  MODULE mod_pack
+    INTEGER,PARAMETER :: integer_size=4
+    INTEGER,PARAMETER :: pack_buffer_max_size=integer_size*1024*1024
+    INTEGER(kind=8),POINTER,SAVE      :: pack_buffer(:)
+    INTEGER,SAVE      :: pack_pos
+    
+    INTERFACE pack
+      MODULE PROCEDURE pack_r,pack_r1,pack_r2,pack_r3,pack_r4,                 &
+                       pack_i,pack_i1,pack_i2,pack_i3,pack_i4,                 &
+                       pack_l,pack_l1,pack_l2,pack_l3,pack_l4,                 &
+                       pack_c,pack_c1,pack_c2,pack_c3,pack_c4
+    END INTERFACE pack
+
+    INTERFACE unpack
+      MODULE PROCEDURE unpack_r,unpack_r1,unpack_r2,unpack_r3,unpack_r4,       &
+                       unpack_i,unpack_i1,unpack_i2,unpack_i3,unpack_i4,       &
+                       unpack_l,unpack_l1,unpack_l2,unpack_l3,unpack_l4,       &
+                       unpack_c,unpack_c1,unpack_c2,unpack_c3,unpack_c4
+    END INTERFACE unpack
+
+    INTERFACE pack_field
+      MODULE PROCEDURE pack_field1,pack_field2,pack_field3,pack_field4        
+    END INTERFACE pack_field
+
+    INTERFACE unpack_field
+      MODULE PROCEDURE unpack_field1,unpack_field2,unpack_field3,unpack_field4 
+    END INTERFACE unpack_field
+           
+  CONTAINS
+  
+    SUBROUTINE set_pack_buffer(pack_buffer0,pack_pos0)
+    IMPLICIT NONE
+    INTEGER(kind=8),POINTER  :: pack_buffer0(:)
+    INTEGER                  :: pack_pos0
+    
+      pack_buffer=>pack_buffer0
+      pack_pos=pack_pos0
+
+    END SUBROUTINE set_pack_buffer
+    
+    
+    SUBROUTINE pack_r(arg)
+      IMPLICIT NONE
+        REAL :: arg
+         
+        CALL packf_r(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE pack_r
+     
+     SUBROUTINE pack_r1(arg)
+      IMPLICIT NONE
+        REAL :: arg(:)
+        
+        CALL packf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_r1
+
+    
+     SUBROUTINE pack_r2(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:)
+        
+        CALL packf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_r2
+     
+     
+     SUBROUTINE pack_r3(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:,:)
+        
+        CALL packf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_r3
+
+     
+     SUBROUTINE pack_r4(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:,:,:)
+        
+        CALL packf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_r4
+
+
+    SUBROUTINE unpack_r(arg)
+      IMPLICIT NONE
+        REAL :: arg
+         
+        CALL unpackf_r(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE unpack_r
+     
+     SUBROUTINE unpack_r1(arg)
+      IMPLICIT NONE
+        REAL :: arg(:)
+        
+        CALL unpackf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_r1
+
+    
+     SUBROUTINE unpack_r2(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:)
+        
+        CALL unpackf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_r2
+     
+     
+     SUBROUTINE unpack_r3(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:,:)
+        
+        CALL unpackf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_r3
+
+     
+     SUBROUTINE unpack_r4(arg)
+      IMPLICIT NONE
+        REAL :: arg(:,:,:,:)
+        
+        CALL unpackf_r(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_r4
+
+
+
+
+    SUBROUTINE pack_i(arg)
+      IMPLICIT NONE
+        INTEGER :: arg
+         
+        CALL packf_i(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE pack_i
+     
+     SUBROUTINE pack_i1(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:)
+        
+        CALL packf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_i1
+
+    
+     SUBROUTINE pack_i2(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:)
+        
+        CALL packf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_i2
+     
+     
+     SUBROUTINE pack_i3(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:,:)
+        
+        CALL packf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_i3
+
+     
+     SUBROUTINE pack_i4(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:,:,:)
+        
+        CALL packf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_i4
+     
+
+    SUBROUTINE unpack_i(arg)
+      IMPLICIT NONE
+        INTEGER :: arg
+         
+        CALL unpackf_i(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE unpack_i
+     
+     SUBROUTINE unpack_i1(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:)
+        
+        CALL unpackf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_i1
+
+    
+     SUBROUTINE unpack_i2(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:)
+        
+        CALL unpackf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_i2
+     
+     
+     SUBROUTINE unpack_i3(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:,:)
+        
+        CALL unpackf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_i3
+
+     
+     SUBROUTINE unpack_i4(arg)
+      IMPLICIT NONE
+        INTEGER :: arg(:,:,:,:)
+        
+        CALL unpackf_i(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_i4     
+
+
+
+
+
+
+
+    SUBROUTINE pack_l(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg
+         
+        CALL packf_l(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE pack_l
+     
+     SUBROUTINE pack_l1(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:)
+        
+        CALL packf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_l1
+
+    
+     SUBROUTINE pack_l2(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:)
+        
+        CALL packf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_l2
+     
+     
+     SUBROUTINE pack_l3(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:,:)
+        
+        CALL packf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_l3
+
+     
+     SUBROUTINE pack_l4(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:,:,:)
+        
+        CALL packf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE pack_l4
+     
+
+    SUBROUTINE unpack_l(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg
+         
+        CALL unpackf_l(pack_buffer(pack_pos),pack_pos,arg,1)
+     
+     END SUBROUTINE unpack_l
+     
+     SUBROUTINE unpack_l1(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:)
+        
+        CALL unpackf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_l1
+
+    
+     SUBROUTINE unpack_l2(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:)
+        
+        CALL unpackf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_l2
+     
+     
+     SUBROUTINE unpack_l3(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:,:)
+        
+        CALL unpackf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_l3
+
+     
+     SUBROUTINE unpack_l4(arg)
+      IMPLICIT NONE
+        LOGICAL :: arg(:,:,:,:)
+        
+        CALL unpackf_l(pack_buffer(pack_pos),pack_pos,arg,size(arg))
+        
+     END SUBROUTINE unpack_l4     
+
+
+
+
+   
+     
+   SUBROUTINE pack_c(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg
+         
+        CALL packf_c(pack_buffer(pack_pos),pack_pos,arg,len(arg))
+     
+     END SUBROUTINE pack_c
+     
+     SUBROUTINE pack_c1(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:)
+        
+        CALL packf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1)))
+        
+     END SUBROUTINE pack_c1
+
+    
+     SUBROUTINE pack_c2(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:)
+        
+        CALL packf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1)))
+        
+     END SUBROUTINE pack_c2
+     
+     
+     SUBROUTINE pack_c3(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:,:)
+        
+        CALL packf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1,1)))
+        
+     END SUBROUTINE pack_c3
+
+     
+     SUBROUTINE pack_c4(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:,:,:)
+        
+        CALL packf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1,1,1)))
+        
+     END SUBROUTINE pack_c4
+     
+
+    SUBROUTINE unpack_c(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg
+         
+        CALL unpackf_c(pack_buffer(pack_pos),pack_pos,arg,len(arg))
+     
+     END SUBROUTINE unpack_c
+     
+     SUBROUTINE unpack_c1(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:)
+        
+        CALL unpackf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1)))
+        
+     END SUBROUTINE unpack_c1
+
+    
+     SUBROUTINE unpack_c2(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:)
+        
+        CALL unpackf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1)))
+        
+     END SUBROUTINE unpack_c2
+     
+     
+     SUBROUTINE unpack_c3(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:,:)
+        
+        CALL unpackf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1,1)))
+        
+     END SUBROUTINE unpack_c3
+
+     
+     SUBROUTINE unpack_c4(arg)
+      IMPLICIT NONE
+        CHARACTER(len=*) :: arg(:,:,:,:)
+        
+        CALL unpackf_c(pack_buffer(pack_pos),pack_pos,arg,size(arg)*len(arg(1,1,1,1)))
+        
+     END SUBROUTINE unpack_c4     
+     
+
+
+
+
+     SUBROUTINE pack_field1(arg)
+     IMPLICIT NONE
+       REAL :: arg(:)
+     
+       CALL packf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE pack_field1
+
+
+     SUBROUTINE pack_field2(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:)
+       
+       CALL packf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE pack_field2
+     
+     SUBROUTINE pack_field3(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:,:)
+     
+       CALL packf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE pack_field3
+
+     SUBROUTINE pack_field4(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:,:,:)
+     
+       CALL packf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE pack_field4
+
+
+
+     SUBROUTINE unpack_field1(arg)
+     IMPLICIT NONE
+       REAL :: arg(:)
+     
+       CALL unpackf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE unpack_field1
+
+
+     SUBROUTINE unpack_field2(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:)
+     
+       CALL unpackf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE unpack_field2
+     
+     SUBROUTINE unpack_field3(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:,:)
+     
+       CALL unpackf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE unpack_field3
+
+     SUBROUTINE unpack_field4(arg)
+     IMPLICIT NONE
+       REAL :: arg(:,:,:,:)
+     
+       CALL unpackf_field(pack_buffer(pack_pos),pack_pos,arg,size(arg)) 
+     END SUBROUTINE unpack_field4
+      
+  END MODULE mod_pack
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_prec.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_prec.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_prec.f90	(revision 8)
@@ -0,0 +1,7 @@
+MODULE mod_prec
+  INTEGER,PARAMETER :: INTEGER_SIZE   = 4 
+  INTEGER,PARAMETER :: REAL_SIZE      = 8 
+  INTEGER,PARAMETER :: LOGICAL_SIZE   = 4 
+  INTEGER,PARAMETER :: CHARACTER_SIZE = 1
+  INTEGER,PARAMETER :: BLOCK_SIZE     = 8
+END MODULE mod_prec
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90	(revision 8)
@@ -0,0 +1,68 @@
+MODULE mod_wait
+  INTEGER, SAVE :: wait_param=10
+  REAL, SAVE    :: opt_param
+
+
+  INTEGER, SAVE :: last_count
+
+CONTAINS
+
+  
+  FUNCTION Top
+  IMPLICIT NONE
+    DOUBLE PRECISION :: Top
+    INTEGER :: count,count_rate,count_max
+    LOGICAL, SAVE :: first=.TRUE.
+    
+      
+    CALL system_clock(count,count_rate,count_max)
+    IF (first) THEN
+      Top=0.
+    ELSE
+      IF (Count>=Last_Count) THEN
+        Top=(1.*(Count-last_Count))/count_rate
+      ELSE
+        Top=(1.*(Count-last_Count+Count_max))/count_rate
+      ENDIF
+    ENDIF
+    Last_Count=Count
+    first=.FALSE. 
+  END FUNCTION Top
+  
+  SUBROUTINE Init_wait
+  IMPLICIT NONE
+    INTEGER :: i,j
+    LOGICAL :: out_ok
+    DOUBLE PRECISION :: time 
+    INTEGER :: last_param
+  
+    out_ok=.FALSE.
+    
+    DO WHILE (.NOT. out_ok)
+      opt_param=0.
+    
+      time=top()
+!CDIR NOVECTOR
+      DO i=1,1000000*wait_param
+         opt_param=opt_param+(i/(i+opt_param))
+      ENDDO
+      time=top()
+      last_param=wait_param
+      wait_param=wait_param*(1./time)
+      IF (ABS(wait_param-last_param)/(0.5*(wait_param+last_param)) <0.01) out_ok=.TRUE.
+    END DO
+  END SUBROUTINE Init_wait
+
+  SUBROUTINE Wait_us(n)
+  IMPLICIT NONE
+  INTEGER :: n
+  INTEGER :: i
+
+!CDIR NOVECTOR  
+    DO i=1,n*wait_param
+         opt_param=opt_param+(i/(i+opt_param))
+    ENDDO
+      
+  END SUBROUTINE Wait_us   
+
+END MODULE mod_wait  
Index: XMLIO_SERVER/trunk/src/IOSERVER/mpitrace.F90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mpitrace.F90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mpitrace.F90	(revision 8)
@@ -0,0 +1,78 @@
+module mpitrace
+  INTEGER,parameter :: VTcheck_buffer=91
+  INTEGER,parameter :: VTprocess_event=92
+  INTEGER,parameter :: VTbuffer_full=93
+  
+  INTEGER,parameter :: nb_inst=7
+  INTEGER :: MPE_begin(nb_inst)
+  INTEGER :: MPE_end(nb_inst)
+  
+contains
+
+  subroutine InitVampir
+    implicit none
+
+#ifdef USE_VT
+    include 'VT.inc'
+    integer :: ierr
+    
+    call VTSYMDEF(VTcheck_buffer,"check_buffer","check_buffer",ierr)
+    call VTSYMDEF(VTprocess_event,"process_event","process_event",ierr)
+    call VTSYMDEF(VTbuffer_full,"buffer_full","buffer_full",ierr)
+    PRINT *,'definition des symbole VT'
+#endif
+
+#ifdef USE_MPE
+    include 'mpe_logf.h' 
+    integer :: ierr,i
+    
+    DO i=1,nb_inst
+      ierr = MPE_Log_get_state_eventIDs( MPE_begin(i), MPE_end(i) )
+    ENDDO
+    
+    ierr = MPE_Describe_state( MPE_begin(VTcaldyn), MPE_end(VTcaldyn),"caldyn", "yellow" )
+    ierr = MPE_Describe_state( MPE_begin(VTintegre), MPE_end(VTintegre),"integre", "blue" )
+    ierr = MPE_Describe_state( MPE_begin(VTadvection), MPE_end(VTadvection),"advection", "green" )
+    ierr = MPE_Describe_state( MPE_begin(VTdissipation), MPE_end(VTdissipation),"dissipation", "ivory" )
+    ierr = MPE_Describe_state( MPE_begin(VThallo), MPE_end(VThallo),"hallo", "orange" )
+    ierr = MPE_Describe_state( MPE_begin(VTphysiq), MPE_end(VTphysiq),"physiq", "purple" )
+    ierr = MPE_Describe_state( MPE_begin(VTinca), MPE_end(VTinca),"inca", "LightBlue" )
+#endif     
+  end subroutine InitVampir
+
+  subroutine VTb(number)
+    implicit none
+    INTEGER :: number
+#ifdef USE_VT    
+    include 'VT.inc'
+    integer :: ierr
+    
+    call VTBEGIN(number,ierr)
+#endif 
+#ifdef USE_MPE
+    include 'mpe_logf.h' 
+    integer :: ierr,i
+    ierr = MPE_Log_event( MPE_begin(number), 0, '' )
+#endif
+
+  end subroutine VTb
+
+  subroutine VTe(number)
+    implicit none
+    INTEGER :: Number
+#ifdef USE_VT    
+    include 'VT.inc'
+    integer :: ierr
+   
+    call VTEND(number,ierr)
+#endif    
+
+#ifdef USE_MPE
+    include 'mpe_logf.h' 
+    integer :: ierr,i
+    ierr = MPE_Log_event( MPE_end(number), 0, '' )
+#endif
+
+  end subroutine VTe
+  
+end module mpitrace
Index: XMLIO_SERVER/trunk/src/IOSERVER/pack_c.c.old
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/pack_c.c.old	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/pack_c.c.old	(revision 8)
@@ -0,0 +1,101 @@
+
+
+
+typedef int     INTEGER ;
+typedef double  REAL    ;
+typedef int     LOGICAL ; 
+typedef char    CHARACTER ;
+
+int INTEGER_SIZE   = 4 ;
+int REAL_SIZE      = 8 ;
+int LOGICAL_SIZE   = 4 ;
+int CHARACTER_SIZE = 1 ;
+
+
+
+
+
+
+
+void packc_r_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*REAL_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
+}
+    
+void packc_i_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*INTEGER_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
+
+}
+
+void packc_l_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*LOGICAL_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
+}
+
+void packc_c_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size, int strsize)
+{
+  int i ;
+   printf("longueur de la chaine %i \n",strsize) ;
+  for(i=0;i<(*size)*CHARACTER_SIZE;i++,(*position)++) buffer[*position]=var[i] ;
+}
+
+
+void unpackc_r_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+
+  for(i=0;i<(*size)*REAL_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
+}
+    
+void unpackc_i_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*INTEGER_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
+
+}
+
+void unpackc_l_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*LOGICAL_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
+}
+
+void unpackc_c_(unsigned char * buffer, INTEGER * position, unsigned char * var, INTEGER * size,int strsize)
+{
+  int i ;
+  
+  for(i=0;i<(*size)*CHARACTER_SIZE;i++,(*position)++) var[i]=buffer[*position] ;
+}
+
+void packc_field_(REAL* buffer, INTEGER* position, REAL* var,INTEGER * size)
+{
+  int i;
+  int s ;
+  
+  s=*size ;
+  buffer+=(*position) ;
+#pragma vdir nooverlap
+  for(i=0;i<s;i++) buffer[i]=var[i] ;
+  position+=s ;
+}
+
+void unpackc_field_(REAL* buffer, INTEGER* position, REAL* var,INTEGER* size)
+{
+  int i;
+  int s ;
+  
+  s=*size ;
+  buffer+=(*position) ;
+#pragma vdir nooverlap
+  for(i=0;i<s;i++) var[i]=buffer[i] ;
+  position+=s ;
+}
Index: XMLIO_SERVER/trunk/src/IOSERVER/pack_f.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/pack_f.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/pack_f.f90	(revision 8)
@@ -0,0 +1,220 @@
+SUBROUTINE packf_r(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    REAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    REAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+
+    tot_size=var_size*REAL_SIZE
+
+    DO i=1,var_size
+      buffer(i)=var(i)
+    ENDDO
+
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+
+END SUBROUTINE packf_r
+
+
+SUBROUTINE packf_field(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    REAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    REAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*REAL_SIZE
+        
+    DO i=1,var_size
+      buffer(i)=var(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE packf_field
+
+SUBROUTINE packf_i(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    INTEGER,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    INTEGER,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*INTEGER_SIZE
+        
+    DO i=1,var_size
+      buffer(i)=var(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE packf_i
+
+SUBROUTINE packf_l(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    LOGICAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    LOGICAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*LOGICAL_SIZE
+        
+    DO i=1,var_size
+      buffer(i)=var(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE packf_l
+
+SUBROUTINE packf_c(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER                  :: var_size
+    CHARACTER(LEN=var_size)  :: buffer
+    INTEGER                  :: position
+    CHARACTER(LEN=var_size)  :: var
+   
+    INTEGER :: tot_size
+    
+    tot_size=var_size*CHARACTER_SIZE
+        
+    buffer(1:var_size)=var(1:var_size)
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE packf_c
+
+
+
+
+
+
+SUBROUTINE unpackf_r(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    REAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    REAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*REAL_SIZE
+        
+    DO i=1,var_size
+      var(i)=buffer(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE unpackf_r
+
+
+SUBROUTINE unpackf_field(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    REAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    REAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*REAL_SIZE
+        
+    DO i=1,var_size
+      var(i)=buffer(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE unpackf_field
+
+SUBROUTINE unpackf_i(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    INTEGER,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    INTEGER,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*INTEGER_SIZE
+        
+    DO i=1,var_size
+      var(i)=buffer(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE unpackf_i
+
+SUBROUTINE unpackf_l(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER           :: var_size
+    LOGICAL,DIMENSION(var_size) :: buffer
+    INTEGER           :: position
+    LOGICAL,DIMENSION(var_size) :: var
+   
+    INTEGER :: i
+    INTEGER :: tot_size
+    
+    tot_size=var_size*LOGICAL_SIZE
+        
+    DO i=1,var_size
+      var(i)=buffer(i)
+    ENDDO
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE unpackf_l
+
+SUBROUTINE unpackf_c(buffer,position,var,var_size)
+  USE mod_prec
+  IMPLICIT NONE
+    INTEGER                  :: var_size
+    CHARACTER(LEN=var_size)  :: buffer
+    INTEGER                  :: position
+    CHARACTER(LEN=var_size)  :: var
+    
+    INTEGER :: tot_size
+    
+    tot_size=var_size*CHARACTER_SIZE
+        
+    var(1:var_size)=buffer(1:var_size)
+          
+    position=position+tot_size/BLOCK_SIZE
+    IF (MOD(tot_size,BLOCK_SIZE)/=0) position=position+1
+    
+END SUBROUTINE unpackf_c
Index: XMLIO_SERVER/trunk/src/IOSERVER/server.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/server.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/IOSERVER/server.f90	(revision 8)
@@ -0,0 +1,43 @@
+PROGRAM server
+  USE mod_ioserver_para
+  USE mod_mpi_buffer_server
+  USE mod_wait
+  USE mod_global_memory
+  USE ioipsl
+  USE iomanager
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+  INCLUDE 'mpif.h'
+  
+  INTEGER :: i,j,ierr
+  LOGICAL :: is_terminated
+  
+  CALL SLEEP(60)
+  PRINT *,'je suis un serveur'
+  CALL init_parallel
+  CALL init_mpi_buffer
+  CALL init_wait
+  CALL init_interface_ioipsl
+  
+  CALL iom__init(nb_client,mpi_size,mpi_rank)
+  PRINT *,'je suis un serveur'
+  
+
+!  CALL MPI_BARRIER(iocomm,ierr)
+  
+  is_terminated=.FALSE.
+  
+  DO WHILE (.NOT. is_terminated)
+    CALL Check_buffer
+    CALL process_request(is_terminated)
+!    CALL wait_us(10)
+  ENDDO
+
+!  CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
+  CALL histclo
+  
+  CALL Finalize_parallel
+
+  PRINT *,"THAT'S ALL FOLK"
+  
+END PROGRAM server
Index: XMLIO_SERVER/trunk/src/XMLIO/create_template
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/create_template	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/create_template	(revision 8)
@@ -0,0 +1,38 @@
+sed "s/#TYPE#/field/g" vector_def.template > vector_field_def.inc
+sed "s/#TYPE#/field/g" vector_contains.template > vector_field_contains.inc
+
+sed "s/#TYPE#/field_group/g" vector_def.template > vector_field_group_def.inc
+sed "s/#TYPE#/field_group/g" vector_contains.template > vector_field_group_contains.inc
+
+sed "s/#TYPE#/axis/g" vector_def.template > vector_axis_def.inc
+sed "s/#TYPE#/axis/g" vector_contains.template > vector_axis_contains.inc
+
+sed "s/#TYPE#/axis_group/g" vector_def.template > vector_axis_group_def.inc
+sed "s/#TYPE#/axis_group/g" vector_contains.template > vector_axis_group_contains.inc
+
+sed "s/#TYPE#/node/g" vector_def.template > vector_node_def.inc
+sed "s/#TYPE#/node/g" vector_contains.template > vector_node_contains.inc
+
+sed "s/#TYPE#/domain/g" vector_def.template > vector_domain_def.inc
+sed "s/#TYPE#/domain/g" vector_contains.template > vector_domain_contains.inc
+
+sed "s/#TYPE#/grid/g" vector_def.template > vector_grid_def.inc
+sed "s/#TYPE#/grid/g" vector_contains.template > vector_grid_contains.inc
+
+sed "s/#TYPE#/grid_group/g" vector_def.template > vector_grid_group_def.inc
+sed "s/#TYPE#/grid_group/g" vector_contains.template > vector_grid_group_contains.inc
+
+sed "s/#TYPE#/file/g" vector_def.template > vector_file_def.inc
+sed "s/#TYPE#/file/g" vector_contains.template > vector_file_contains.inc
+
+sed "s/#TYPE#/file_group/g" vector_def.template > vector_file_group_def.inc
+sed "s/#TYPE#/file_group/g" vector_contains.template > vector_file_group_contains.inc
+
+sed "s/#TYPE#/file_dep/g" vector_def.template > vector_file_dep_def.inc
+sed "s/#TYPE#/file_dep/g" vector_contains.template > vector_file_dep_contains.inc
+
+sed "s/#TYPE#/field_dep/g" vector_def.template > vector_field_dep_def.inc
+sed "s/#TYPE#/field_dep/g" vector_contains.template > vector_field_dep_contains.inc
+
+sed "s/#TYPE#/field_out/g" vector_def.template > vector_field_out_def.inc
+sed "s/#TYPE#/field_out/g" vector_contains.template > vector_field_out_contains.inc
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_axis.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_axis.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_axis.f90	(revision 8)
@@ -0,0 +1,239 @@
+MODULE mod_axis
+
+  USE mod_xmlio_parameters
+  USE mod_sorted_list
+
+  
+  IMPLICIT NONE
+
+  TYPE, PUBLIC :: axis
+    CHARACTER(len=str_len)      :: id
+    LOGICAL                     :: has_id
+    CHARACTER(len=str_len)      :: name
+    LOGICAL                     :: has_name
+    INTEGER                     :: size
+    LOGICAL                     :: has_size
+    CHARACTER(len=str_len)      :: description
+    LOGICAL                     :: has_description
+    CHARACTER(len=str_len)      :: unit
+    LOGICAL                     :: has_unit
+    REAL, DIMENSION(:), POINTER :: values
+    LOGICAL                     :: has_values
+
+  END TYPE axis
+
+  INCLUDE 'vector_axis_def.inc'
+  
+  TYPE(vector_axis),POINTER,SAVE             :: axis_Ids
+  TYPE(sorted_list),POINTER,SAVE,PRIVATE     :: Ids 
+
+CONTAINS
+  INCLUDE 'vector_axis_contains.inc'
+
+  SUBROUTINE axis__init
+  IMPLICIT NONE
+    
+    ALLOCATE(axis_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_axis__new(axis_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE axis__init
+  
+  SUBROUTINE axis__get(Id,Pt_axis)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(axis),POINTER              :: Pt_axis
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_axis=>axis_ids%at(Pos)%Pt
+    ELSE
+      Pt_axis=>NULL()
+    ENDIF
+    
+  END SUBROUTINE axis__get
+  
+  SUBROUTINE axis__new(pt_axis,Id)
+  USE string_function
+  IMPLICIT NONE
+   TYPE(axis), POINTER           :: pt_axis
+   CHARACTER(LEN=*),OPTIONAL     :: Id
+   INTEGER                       :: Pos
+   
+   pt_axis%has_id         = .FALSE.
+   pt_axis%has_name        = .FALSE.
+   pt_axis%has_size        = .FALSE.
+   pt_axis%has_description = .FALSE.
+   pt_axis%has_unit        = .FALSE.
+   pt_axis%has_values      = .FALSE.
+   
+   IF (PRESENT(Id)) THEN
+     Pt_axis%id=TRIM(ADJUSTL(Id))
+     Pt_axis%has_id=.TRUE.
+     CALL vector_axis__set_new(axis_Ids,Pt_axis,Pos)
+     CALL sorted_list__Add(Ids,hash(id),Pos)
+   ENDIF
+
+ END SUBROUTINE axis__new
+
+  SUBROUTINE axis__set(pt_axis, name, description, unit, a_size, values)
+  IMPLICIT NONE
+    TYPE(axis), POINTER         :: pt_axis
+    CHARACTER(len=*)  ,OPTIONAL :: name
+    CHARACTER(len=*)  ,OPTIONAL :: description
+    CHARACTER(len=*)  ,OPTIONAL :: unit
+    INTEGER           ,OPTIONAL :: a_size
+    REAL, DIMENSION(:),OPTIONAL :: values
+
+    IF (PRESENT(name)) THEN
+        pt_axis%name=TRIM(ADJUSTL(name))
+        pt_axis%has_name = .TRUE.
+    ENDIF
+
+    IF (PRESENT(description)) THEN
+        pt_axis%description=TRIM(ADJUSTL(description))
+        pt_axis%has_description = .TRUE.
+    ENDIF
+ 
+    IF (PRESENT(unit)) then
+        pt_axis%unit=TRIM(ADJUSTL(unit))
+        pt_axis%has_unit = .TRUE.
+    ENDIF
+
+    IF (PRESENT(a_size)) then
+        pt_axis%size=a_size
+        pt_axis%has_size = .TRUE.
+    ENDIF
+    
+    IF (PRESENT(values)) then
+        IF (pt_axis%has_values) DEALLOCATE(pt_axis%values)  
+        ALLOCATE(pt_axis%values(size(values)))
+        pt_axis%values(:)=values(:)
+        pt_axis%has_values = .TRUE.
+    ENDIF
+
+  END SUBROUTINE axis__set
+
+  SUBROUTINE axis__print(pt_axis)
+  IMPLICIT NONE
+    TYPE(axis), POINTER         :: pt_axis
+
+    PRINT *,"---- AXIS ----"
+    IF (pt_axis%has_id) THEN
+      PRINT *,"id = ",TRIM(pt_axis%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    IF (pt_axis%has_name) THEN
+      PRINT *,"name = ",TRIM(pt_axis%name)
+    ELSE
+      PRINT *,"name undefined"
+    ENDIF
+    
+    IF (pt_axis%has_description) THEN
+      PRINT *,"description = ",TRIM(pt_axis%description)
+    ELSE
+      PRINT *,"description undefined"
+    ENDIF
+ 
+    IF (pt_axis%has_unit) THEN
+      PRINT *,"unit = ",TRIM(pt_axis%unit)
+    ELSE
+      PRINT *,"unit undefined"
+    ENDIF
+
+    IF (pt_axis%has_size) THEN
+      PRINT *,"size = ",pt_axis%size
+    ELSE
+      PRINT *,"size undefined"
+    ENDIF
+
+    IF (pt_axis%has_values) THEN
+      PRINT *,"values = ",pt_axis%values
+    ELSE
+      PRINT *,"values undefined"
+    ENDIF
+
+  END SUBROUTINE axis__print
+
+
+  SUBROUTINE axis__apply_default(pt_axis_default, pt_axis_in, pt_axis_out)
+
+    TYPE(axis), POINTER :: pt_axis_default, pt_axis_in, pt_axis_out
+
+    IF (pt_axis_in%has_name) THEN
+        pt_axis_out%name=pt_axis_in%name
+        pt_axis_out%has_name=.TRUE.
+    ELSE IF ( pt_axis_default%has_name) THEN
+        pt_axis_out%name=pt_axis_default%name
+        pt_axis_out%has_name=.TRUE.
+    ELSE
+        pt_axis_out%has_name=.FALSE.
+    ENDIF
+        
+    IF (pt_axis_in%has_description) THEN
+        pt_axis_out%description=pt_axis_in%description
+        pt_axis_out%has_description=.TRUE.
+    ELSE IF ( pt_axis_default%has_description ) THEN
+        pt_axis_out%description=pt_axis_default%description
+        pt_axis_out%has_description=.TRUE.
+    ELSE
+        pt_axis_out%has_description=.FALSE.
+    ENDIF
+
+    IF (pt_axis_in%has_unit) THEN
+        pt_axis_out%unit=pt_axis_in%unit
+        pt_axis_out%has_unit=.TRUE.
+    ELSE IF ( pt_axis_default%has_unit ) THEN
+        pt_axis_out%unit=pt_axis_default%unit
+        pt_axis_out%has_unit=.TRUE.
+    ELSE
+        pt_axis_out%has_unit=.FALSE.
+    ENDIF
+
+    IF (pt_axis_in%has_size) THEN
+        pt_axis_out%size=pt_axis_in%size
+        pt_axis_out%has_size=.TRUE.
+    ELSE IF ( pt_axis_default%has_size ) THEN
+        pt_axis_out%size=pt_axis_default%size
+        pt_axis_out%has_size=.TRUE.
+    ELSE
+        pt_axis_out%has_size=.FALSE.
+    ENDIF
+
+    IF (pt_axis_in%has_values) THEN
+        pt_axis_out%values(:)=pt_axis_in%values(:)
+        pt_axis_out%has_values=.TRUE.
+    ELSE IF ( pt_axis_default%has_values ) THEN
+        pt_axis_out%values(:)=pt_axis_default%values(:)
+        pt_axis_out%has_values=.TRUE.
+    ELSE
+        pt_axis_out%has_values=.FALSE.
+    ENDIF
+    
+  END SUBROUTINE axis__apply_default
+
+  SUBROUTINE axis__check(pt_axis)
+  USE error_msg
+  IMPLICIT NONE
+    TYPE(axis), POINTER :: pt_axis
+      
+    IF (.NOT. pt_axis%has_name) THEN
+      IF (pt_axis%has_id) THEN
+        pt_axis%name=TRIM(pt_axis%id)
+      ELSE
+        WRITE(message,*) "Axis has no name and no id" 
+        CALL error("mod_axis::axis__check")
+      ENDIF 
+    ENDIF
+ 
+ END SUBROUTINE axis__Check
+
+END MODULE mod_axis
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_axis_definition.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_axis_definition.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_axis_definition.f90	(revision 8)
@@ -0,0 +1,17 @@
+MODULE mod_axis_definition
+  USE mod_axis_group
+  
+  TYPE(axis_group),SAVE,POINTER :: axis_definition
+  
+CONTAINS
+
+  SUBROUTINE axis_definition__Init
+  USE mod_axis_group
+  IMPLICIT NONE
+  
+    ALLOCATE(axis_definition)
+    CALL axis_group__new(axis_definition,"axis_definition")
+    
+  END SUBROUTINE axis_definition__Init
+        
+END MODULE mod_axis_definition
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_axis_group.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_axis_group.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_axis_group.f90	(revision 8)
@@ -0,0 +1,190 @@
+MODULE mod_axis_group
+  USE mod_axis
+  USE mod_xmlio_parameters
+
+  IMPLICIT NONE
+
+  TYPE axis_group
+    CHARACTER(LEN=str_len)                    :: id
+    LOGICAL                                   :: has_id
+    TYPE(vector_axis_group), POINTER          :: groups
+    TYPE(vector_axis),POINTER                 :: axis     
+    TYPE(axis), POINTER                       :: default_attribut
+  END TYPE axis_group
+
+  INCLUDE "vector_axis_group_def.inc"  
+
+  TYPE(vector_axis_group),POINTER       :: axis_group_Ids
+  TYPE(sorted_list),POINTER,PRIVATE     :: Ids 
+
+CONTAINS
+
+  INCLUDE "vector_axis_group_contains.inc"
+
+  SUBROUTINE axis_group__init
+  IMPLICIT NONE
+    
+    ALLOCATE(axis_group_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_axis_group__new(axis_group_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE axis_group__init
+
+  SUBROUTINE axis_group__get(Id,Pt_ag)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(axis_group),POINTER        :: Pt_ag
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_ag=>axis_group_ids%at(Pos)%Pt
+    ELSE
+      Pt_ag=>NULL()
+    ENDIF
+    
+  END SUBROUTINE axis_group__get
+    
+  RECURSIVE SUBROUTINE axis_group__new(Pt_ag,Id)
+  USE string_function
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER                :: Pt_ag
+    CHARACTER(LEN=*),OPTIONAL,INTENT(IN)     :: Id
+    
+    INTEGER :: Pos
+    
+    ALLOCATE(Pt_ag%groups)
+    ALLOCATE(Pt_ag%axis)
+    ALLOCATE(Pt_ag%default_attribut)
+    
+    CALL vector_axis_group__new(Pt_ag%groups)
+    CALL vector_axis__new(Pt_ag%axis)
+    CALL axis__new(Pt_ag%default_attribut)
+    Pt_ag%has_id=.FALSE.
+      
+    IF (PRESENT(Id)) THEN
+      Pt_ag%id=TRIM(Id)
+      Pt_ag%has_id=.TRUE.
+      CALL vector_axis_group__set_new(axis_group_Ids,Pt_ag,Pos)
+      CALL sorted_list__Add(Ids,hash(id),Pos)
+    ENDIF
+
+  END SUBROUTINE axis_group__new
+
+      
+  SUBROUTINE axis_group__get_new_group(Pt_ag,Pt_ag_out,Id)
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER             :: Pt_ag
+    TYPE(axis_group),POINTER             :: Pt_ag_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_axis_group__get_new(Pt_ag%groups,Pt_ag_out)
+    CALL axis_group__new(Pt_ag_out)
+
+    IF (PRESENT(id)) THEN
+      CALL axis_group__new(Pt_ag_out,Id)
+    ELSE
+      CALL axis_group__new(Pt_ag_out)
+    ENDIF
+    
+  END SUBROUTINE axis_group__get_new_group
+
+  
+  SUBROUTINE axis_group__get_new_axis(Pt_ag,Pt_a_out,Id)
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER            :: Pt_ag
+    TYPE(axis),POINTER                  :: Pt_a_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_axis__get_new(Pt_ag%axis,Pt_a_out)
+    
+    IF (PRESENT(id)) THEN
+      CALL axis__new(Pt_a_out,Id)
+    ELSE
+      CALL axis__new(Pt_a_out)
+    ENDIF
+    
+  END SUBROUTINE axis_group__get_new_axis
+  
+  
+  SUBROUTINE axis_group__get_default_attribut(Pt_ag,Pt_a)
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER  :: Pt_ag
+    TYPE(axis),POINTER        :: Pt_a
+    
+    Pt_a=>Pt_ag%default_attribut
+  END SUBROUTINE axis_group__get_default_attribut
+  
+  RECURSIVE SUBROUTINE axis_group__apply_default(Pt_ag,default)
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER           :: Pt_ag
+    TYPE(axis),POINTER,OPTIONAL        :: default
+    
+    INTEGER :: i
+    
+    IF (PRESENT(default)) THEN
+      CALL axis__apply_default(default,Pt_ag%default_attribut,Pt_ag%default_attribut)
+    ENDIF
+      
+    DO i=1,Pt_ag%groups%size
+      CALL axis_group__apply_default(Pt_ag%groups%at(i)%pt,Pt_ag%default_attribut)
+    ENDDO
+    
+    DO i=1,Pt_ag%axis%size
+      CALL axis__apply_default(Pt_ag%default_attribut,Pt_ag%axis%at(i)%pt,Pt_ag%axis%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE axis_group__apply_default
+
+  RECURSIVE SUBROUTINE axis_group__print(Pt_ag)
+  IMPLICIT NONE
+    TYPE(axis_group),POINTER  :: Pt_ag
+   
+    INTEGER :: i
+    
+    PRINT *,"--- AXIS GROUP ---"
+    IF (pt_ag%has_id) THEN
+      PRINT *,"id = ",TRIM(pt_ag%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    PRINT *,"axis default attribut :"
+    CALL axis__print(Pt_ag%default_attribut)    
+
+    PRINT *,"owned axis groups :",Pt_ag%groups%size      
+    DO i=1,Pt_ag%groups%size
+      CALL axis_group__print(Pt_ag%groups%at(i)%pt)
+    ENDDO
+
+    PRINT *,"owned axis :",Pt_ag%axis%size      
+    DO i=1,Pt_ag%axis%size
+      CALL axis__print(Pt_ag%axis%at(i)%pt)
+    ENDDO
+    PRINT *,"------------"
+    
+  END SUBROUTINE axis_group__print
+
+  RECURSIVE SUBROUTINE axis_group__Check(Pt_ag)
+  IMPLICIT NONE
+  
+    TYPE(axis_group),POINTER  :: Pt_ag
+    INTEGER :: i
+   
+    DO i=1,Pt_ag%groups%size
+      CALL axis_group__check(pt_ag%groups%at(i)%pt)
+    ENDDO
+
+    DO i=1,Pt_ag%axis%size
+      CALL axis__check(pt_ag%axis%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE axis_group__check     
+   
+END MODULE mod_axis_group
+
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_dependency.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_dependency.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_dependency.f90	(revision 8)
@@ -0,0 +1,220 @@
+MODULE mod_dependency
+USE mod_field
+USE mod_file
+USE mod_grid
+USE mod_axis
+USE mod_sorted_list
+
+TYPE file_dep
+  TYPE(file),POINTER           :: file
+  INTEGER                      :: hash
+  TYPE(vector_field),POINTER   :: fields
+  TYPE(vector_grid),POINTER    :: grids
+  TYPE(vector_axis),POINTER    :: axis
+END TYPE file_dep
+
+TYPE field_dep
+  TYPE(field),POINTER :: field
+  INTEGER             :: hash
+  
+  TYPE(vector_field_out),POINTER   :: field_out
+END TYPE field_dep
+
+TYPE field_out
+  TYPE(Field), POINTER  :: field
+  TYPE(file),  POINTER  :: file
+  TYPE(axis),  POINTER  :: axis
+  TYPE(grid),  POINTER  :: grid
+END TYPE field_out
+
+INCLUDE 'vector_field_dep_def.inc'
+INCLUDE 'vector_file_dep_def.inc'
+INCLUDE 'vector_field_out_def.inc'
+
+TYPE(vector_file_dep),POINTER      :: file_enabled
+TYPE(vector_field_out),POINTER     :: field_enabled 
+TYPE(vector_field_dep),POINTER     :: field_id
+
+ 
+TYPE(sorted_list),POINTER :: sorted_id
+
+CONTAINS
+
+INCLUDE 'vector_field_dep_contains.inc'
+INCLUDE 'vector_file_dep_contains.inc'
+INCLUDE 'vector_field_out_contains.inc'
+
+  SUBROUTINE set_dependency
+  IMPLICIT NONE
+  
+   CALL set_file_dependency
+   CALL set_field_enabled
+   CALL set_field_dependency
+
+  END SUBROUTINE set_dependency
+  
+  
+  RECURSIVE SUBROUTINE set_file_dependency(Pt_file_group)
+  USE mod_file_definition
+  USE mod_file_group
+  USE string_function
+  USE mod_sorted_list
+  IMPLICIT NONE
+    TYPE (file_group),POINTER,OPTIONAL :: pt_file_group 
+    TYPE (file_group),POINTER          :: Pt_fg
+    TYPE (file)     ,POINTER           :: Pt_file
+    TYPE (file_dep),POINTER            :: Pt_file_dep
+    TYPE (sorted_list),POINTER         :: sorted_axis
+    TYPE (sorted_list),POINTER         :: sorted_grid
+    INTEGER                            :: i
+    INTEGER                            :: j
+    
+    ALLOCATE(sorted_axis)
+    ALLOCATE(sorted_grid)
+    
+    IF (PRESENT(Pt_file_group)) THEN
+      Pt_fg=>Pt_file_group
+    ELSE
+      ALLOCATE(file_enabled)
+      CALL vector_file_dep__new(file_enabled)
+      Pt_fg=>file_definition
+    ENDIF
+    
+    DO i=1,Pt_fg%groups%size
+      CALL set_file_dependency(Pt_fg%groups%at(i)%pt)
+    ENDDO
+    
+    DO i=1,Pt_fg%files%size
+      Pt_file=>pt_fg%files%at(i)%pt
+      IF (Pt_file%enabled) THEN
+        CALL vector_file_dep__get_new(file_enabled,Pt_file_dep)
+        
+        ALLOCATE(Pt_file_dep%fields)
+        ALLOCATE(Pt_file_dep%grids)
+        ALLOCATE(Pt_file_dep%axis)
+        pt_file_dep%file=>pt_file
+        pt_file_dep%hash=hash(pt_file%id)
+        CALL vector_field__new(Pt_file_dep%fields)
+        CALL vector_grid__new(Pt_file_dep%grids)
+        CALL vector_axis__new(Pt_file_dep%axis)
+        CALL sorted_list__new(sorted_axis)
+        CALL sorted_list__new(sorted_grid)
+        
+        CALL Treat_field_group(pt_file%field_list)
+        
+        CALL sorted_list__delete(sorted_axis)
+        CALL sorted_list__delete(sorted_grid)
+      ENDIF
+    ENDDO
+    
+    CONTAINS 
+      RECURSIVE SUBROUTINE treat_field_group(pt_fg)
+      IMPLICIT NONE  
+        TYPE(field_group),POINTER :: Pt_fg
+        INTEGER                   :: i
+        
+        DO i=1,Pt_fg%groups%size
+          CALL treat_field_group(Pt_fg%groups%at(i)%pt)
+        ENDDO
+        
+        DO i=1,Pt_fg%fields%size
+          CALL treat_field(Pt_fg%fields%at(i)%pt)
+        ENDDO
+      END SUBROUTINE treat_field_group
+      
+      
+      SUBROUTINE treat_field(pt_field)
+      IMPLICIT NONE  
+        TYPE(field),POINTER :: Pt_field
+        LOGICAL             :: found
+        INTEGER             :: Pos
+
+        IF (Pt_field%enabled .AND. Pt_field%level <= Pt_file%output_level) THEN
+          CALL vector_field__set_new(Pt_file_dep%fields,Pt_field)
+  
+          IF (Pt_field%has_grid) THEN
+            CALL sorted_list__find(sorted_grid,hash(Pt_field%grid%id),pos,found)
+            IF (.NOT. found) THEN 
+              CALL vector_grid__set_new(pt_file_dep%grids,Pt_field%grid,pos)
+              CALL sorted_list__add(sorted_grid,hash(Pt_field%grid%id),pos)
+            ENDIF
+          ENDIF
+  
+          IF (Pt_field%has_axis) THEN
+            CALL sorted_list__find(sorted_axis,hash(Pt_field%axis%id),Pos,found)
+            IF (.NOT. found) THEN 
+              CALL vector_axis__set_new(Pt_file_dep%axis,Pt_field%axis,pos)
+              CALL sorted_list__add(sorted_axis,hash(Pt_field%axis%id),pos)
+            ENDIF
+          ENDIF
+        ENDIF
+      
+      END SUBROUTINE treat_field
+      
+  END SUBROUTINE set_file_dependency
+  
+  SUBROUTINE set_field_enabled
+  IMPLICIT NONE
+  TYPE(file_dep),POINTER   :: pt_file_dep
+  TYPE(field_out),POINTER  :: pt_field_out
+  INTEGER                  :: i
+  INTEGER                  :: j
+  
+    ALLOCATE(field_enabled)
+    CALL vector_field_out__new(field_enabled)
+    
+    DO i=1,file_enabled%size
+      pt_file_dep=>file_enabled%at(i)%pt
+      DO j=1,pt_file_dep%fields%size
+        CALL vector_field_out__get_new(field_enabled,pt_field_out)
+        pt_field_out%field=>pt_file_dep%fields%at(j)%pt
+        pt_field_out%file=>pt_file_dep%file
+        pt_field_out%axis=>pt_field_out%field%axis
+        pt_field_out%grid=>pt_field_out%field%grid
+      ENDDO
+    ENDDO
+   
+      
+  END SUBROUTINE set_field_enabled
+      
+  SUBROUTINE set_field_dependency
+  USE string_function
+  IMPLICIT NONE
+  TYPE(field_out),POINTER :: pt_field_out
+  TYPE(field_dep),POINTER :: pt_field_dep
+  TYPE(field),POINTER     :: pt_field
+  TYPE(field),POINTER     :: pt_field_base
+  INTEGER :: pos
+  LOGICAL :: found
+  INTEGER :: i
+  
+    ALLOCATE(field_id)
+    CALL vector_field_dep__new(field_id)
+
+    ALLOCATE(sorted_id)
+    CALL sorted_list__new(sorted_id)
+    
+    DO i=1,field_enabled%size
+      pt_field_out=>field_enabled%at(i)%pt
+      pt_field=>pt_field_out%field
+      pt_field_base=>pt_field%field_base
+      
+      CALL sorted_list__find(sorted_id,hash(pt_field_base%id),pos,found)
+      IF (.NOT. found) THEN
+        CALL vector_field_dep__get_new(field_id,pt_field_dep,pos)
+        ALLOCATE(pt_field_dep%field_out)
+        CALL vector_field_out__new(pt_field_dep%field_out)
+        pt_field_dep%field=>pt_field_base       
+        CALL sorted_list__add(sorted_id,hash(pt_field_base%id),pos)
+      ELSE
+        pt_field_dep=>field_id%at(pos)%pt
+      ENDIF
+      
+      CALL vector_field_out__set_new(pt_field_dep%field_out,pt_field_out) 
+    ENDDO  
+      
+  END SUBROUTINE set_field_dependency     
+      
+    
+    
+END MODULE mod_dependency
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_domain.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_domain.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_domain.f90	(revision 8)
@@ -0,0 +1,168 @@
+MODULE mod_domain
+   USE mod_xmlio_parameters
+
+   INTEGER, PARAMETER :: box=1
+   INTEGER, PARAMETER :: orange=2
+   
+  TYPE domain
+    INTEGER :: rank
+    INTEGER :: ni
+    INTEGER :: nj
+    INTEGER :: ibegin
+    INTEGER :: iend
+    INTEGER :: jbegin
+    INTEGER :: jend
+    REAL,POINTER :: lon(:,:)
+    REAL,POINTER :: lat(:,:)
+    
+    INTEGER         :: type
+    LOGICAL,POINTER :: mask(:)
+    INTEGER,POINTER :: i_index(:)
+    INTEGER,POINTER :: j_index(:)
+    INTEGER         :: nbp
+    LOGICAL         :: is_defined
+  END TYPE domain
+ 
+  INCLUDE 'vector_domain_def.inc'
+
+CONTAINS
+
+  INCLUDE 'vector_domain_contains.inc'
+
+  SUBROUTINE domain__new(Pt_domain)
+  IMPLICIT NONE
+    TYPE(domain),POINTER  :: Pt_domain
+    
+    Pt_domain%is_defined=.FALSE.
+    
+  END SUBROUTINE domain__new
+  
+  SUBROUTINE domain__set(Pt_domain,rank,ni,nj,ibegin,jbegin,lon,lat)
+  IMPLICIT NONE
+    TYPE(domain),POINTER  :: Pt_domain
+    INTEGER,INTENT(IN) :: rank
+    INTEGER,INTENT(IN) :: ni
+    INTEGER,INTENT(IN) :: nj
+    INTEGER,INTENT(IN) :: ibegin
+    INTEGER,INTENT(IN) :: jbegin
+    REAL,INTENT(IN)    :: lon(ni,nj)
+    REAL,INTENT(IN)    :: lat(ni,nj)
+
+    Pt_domain%rank=rank
+    Pt_domain%ni=ni
+    Pt_domain%nj=nj
+    Pt_domain%ibegin=ibegin
+    Pt_domain%jbegin=jbegin   
+    Pt_domain%iend=ibegin+ni-1
+    Pt_domain%jend=jbegin+nj-1
+    ALLOCATE(Pt_domain%lon(ni,nj))
+    ALLOCATE(Pt_domain%lat(ni,nj))
+    Pt_domain%lon(:,:)=lon(:,:)
+    Pt_domain%lat(:,:)=lat(:,:)
+    Pt_domain%is_defined=.TRUE.
+  END SUBROUTINE domain__set
+
+
+  SUBROUTINE domain__set_type_box(Pt_domain,mask)
+  USE error_msg
+  IMPLICIT NONE
+    TYPE(domain),POINTER  :: Pt_domain
+    LOGICAL,INTENT(IN),OPTIONAL :: mask(:,:)
+    INTEGER                     :: i,j
+  
+    Pt_domain%type=box
+    pt_domain%nbp=pt_domain%ni*pt_domain%nj
+    ALLOCATE(Pt_domain%i_index(pt_domain%nbp))
+    ALLOCATE(Pt_domain%j_index(pt_domain%nbp))
+    ALLOCATE(pt_domain%mask(pt_domain%nbp))
+
+    IF (PRESENT(mask)) THEN
+      IF ( size(mask,1)==pt_domain%ni .AND. size(mask,2)==pt_domain%nj) THEN
+        DO i=1,pt_domain%ni
+          DO j=1,pt_domain%nj
+            pt_domain%mask((j-1)*pt_domain%ni+i)=mask(i,j)
+          ENDDO
+        ENDDO
+      ELSE
+        WRITE (message,*) "mask dimensions are not compliant with domain dimensions :",   &
+                           size(mask,1),",",size(mask,2),"/=",Pt_domain%ni,",",Pt_domain%nj
+        CALL error("domain__set_type_box")
+      ENDIF
+    ELSE
+      pt_domain%mask(:)=.TRUE.
+    ENDIF
+    
+    DO i=1,pt_domain%ni
+      DO j=1,pt_domain%nj
+        pt_domain%i_index((j-1)*pt_domain%ni+i) = i
+        pt_domain%j_index((j-1)*pt_domain%ni+i) = j
+      ENDDO
+    ENDDO
+
+  END SUBROUTINE domain__set_type_box
+
+
+  SUBROUTINE domain__set_type_orange(Pt_domain,nbp,offset,opt_index)
+  IMPLICIT NONE
+    TYPE(domain),POINTER        :: Pt_domain
+    INTEGER,INTENT(IN)          :: nbp
+    INTEGER,INTENT(IN)          :: offset
+    INTEGER,INTENT(IN),OPTIONAL :: opt_index(:)
+    
+    INTEGER  :: index(nbp)
+    INTEGER  :: i
+    
+    Pt_domain%type=orange
+    
+    IF (PRESENT(opt_index)) THEN
+      index(:)=opt_index(:)       
+    ELSE
+      DO i=1,nbp
+        index(i)=i
+      ENDDO
+    ENDIF
+
+    ALLOCATE(pt_domain%i_index(nbp))
+    ALLOCATE(pt_domain%j_index(nbp))
+        
+    DO i=1,nbp
+      Pt_domain%i_index(i)=(index(i)+offset)/pt_domain%nj+1+pt_domain%ibegin-1
+      Pt_domain%j_index(i)=MOD(index(i)+offset,pt_domain%nj)+1+pt_domain%jbegin-1
+    ENDDO
+
+    Pt_domain%mask(:)=.TRUE.
+
+  END SUBROUTINE domain__set_type_orange
+
+
+    
+  SUBROUTINE domain__print(pt_domain)
+  IMPLICIT NONE
+    TYPE(domain),POINTER   :: Pt_domain
+
+    PRINT *,"---- DOMAIN ----"
+    
+    IF (pt_domain%is_defined) THEN
+      PRINT *,"rank :",pt_domain%rank
+      PRINT *,"ni :",pt_domain%ni
+      PRINT *,"nj :",pt_domain%nj
+      PRINT *,"ibegin",pt_domain%ibegin
+      PRINT *,"iend",pt_domain%iend
+    ELSE
+      PRINT *,"  ---> domain undefined"
+    ENDIF
+    
+    PRINT *,"-----------------"
+  END SUBROUTINE domain__print
+  
+  SUBROUTINE domain__copy(Pt_in,pt_out)
+  IMPLICIT NONE
+    TYPE(domain),POINTER   :: Pt_in
+    TYPE(domain),POINTER   :: Pt_out
+  
+    IF (pt_in%is_defined) THEN
+      CALL domain__set(pt_out,pt_in%rank,pt_in%ni,pt_in%nj,pt_in%ibegin,pt_in%jbegin,pt_in%lon,pt_in%lat)
+    ENDIF
+  END SUBROUTINE domain__copy
+  
+END MODULE mod_domain
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_error_msg.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_error_msg.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_error_msg.f90	(revision 8)
@@ -0,0 +1,40 @@
+MODULE error_msg
+  USE mod_xmlio_parameters,ONLY : str_msg_len
+
+  CHARACTER(LEN=str_msg_len),SAVE :: message
+
+CONTAINS
+
+  SUBROUTINE Warning(sub_name)
+  IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: sub_name
+    
+    IF (PRESENT(sub_name)) THEN
+      PRINT *,"--* WARNING *-- : in subroutine "//sub_name
+    ELSE
+      PRINT *,"--* WARNING *-- "
+    ENDIF
+    
+    PRINT *,"----> ",TRIM(message)
+    message=REPEAT(' ',str_msg_len)
+    
+  END SUBROUTINE warning
+  
+  SUBROUTINE error(sub_name)
+  IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: sub_name
+    
+    IF (PRESENT(sub_name)) THEN
+      PRINT *,"--* WARNING *-- : in subroutine "//sub_name
+    ELSE
+      PRINT *,"--* WARNING *-- "
+    ENDIF
+
+    PRINT *,"----> ",TRIM(message)
+    message=REPEAT(' ',str_msg_len)
+    
+    STOP 
+  
+  END SUBROUTINE error    
+
+END MODULE error_msg
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_field.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_field.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_field.f90	(revision 8)
@@ -0,0 +1,522 @@
+MODULE mod_field
+
+  USE mod_xmlio_parameters
+  USE mod_sorted_list
+  USE mod_axis
+  USE mod_grid
+    
+  IMPLICIT NONE
+
+  TYPE, PUBLIC :: field
+    CHARACTER(len=str_len)         :: id
+    LOGICAL                        :: has_id
+    CHARACTER(len=str_len)         :: name
+    LOGICAL                        :: has_name
+    CHARACTER(len=str_len)         :: description
+    LOGICAL                        :: has_description
+    CHARACTER(len=str_len)         :: unit
+    LOGICAL                        :: has_unit
+    CHARACTER(len=str_len)         :: operation
+    LOGICAL                        :: has_operation
+    INTEGER                        :: freq_op
+    LOGICAL                        :: has_freq_op
+    CHARACTER(len=str_len)         :: axis_ref
+    LOGICAL                        :: has_axis_ref
+    CHARACTER(len=str_len)         :: grid_ref
+    LOGICAL                        :: has_grid_ref
+    INTEGER                        :: level
+    LOGICAL                        :: has_level
+    INTEGER                        :: prec
+    LOGICAL                        :: has_prec
+    CHARACTER(len=str_len)         :: field_ref
+    LOGICAL                        :: has_field_ref
+    TYPE(field),POINTER            :: field_base
+    LOGICAL                        :: has_field_base
+    LOGICAL                        :: enabled
+    LOGICAL                        :: has_enabled
+    LOGICAL                        :: solved_field_ref
+    TYPE(axis), POINTER            :: axis
+    LOGICAL                        :: has_axis
+    TYPE(grid),POINTER             :: grid
+    LOGICAL                        :: has_grid
+    INTEGER                        :: internal(internal_field)
+    
+    
+  END TYPE field
+  
+  INCLUDE 'vector_field_def.inc'
+  
+  TYPE(vector_field),POINTER            :: field_Ids
+  TYPE(sorted_list),POINTER,PRIVATE     :: Ids 
+
+CONTAINS
+  INCLUDE 'vector_field_contains.inc'
+  
+  SUBROUTINE field__init
+  IMPLICIT NONE
+    
+    ALLOCATE(field_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_field__new(field_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE field__init
+  
+  SUBROUTINE field__get(Id,Pt_field)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(field),POINTER             :: Pt_field
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_field=>field_ids%at(Pos)%Pt
+    ELSE
+      Pt_field=>NULL()
+    ENDIF
+    
+  END SUBROUTINE field__get
+    
+  
+  SUBROUTINE field__new(pt_field,Id)
+   USE string_function
+   IMPLICIT NONE
+   TYPE(field), POINTER          :: pt_field
+   CHARACTER(LEN=*),OPTIONAL     :: Id
+   
+   INTEGER              :: Pos
+
+   Pt_field%has_id=.FALSE.
+   pt_field%has_name = .FALSE.
+   pt_field%has_description = .FALSE.
+   pt_field%has_unit = .FALSE.
+   pt_field%has_operation = .FALSE.
+   pt_field%has_freq_op = .FALSE.
+   pt_field%has_axis_ref = .FALSE.
+   pt_field%has_grid_ref = .FALSE.
+   pt_field%has_prec = .FALSE.
+   pt_field%has_level = .FALSE. 
+   pt_field%has_field_ref = .FALSE.
+   pt_field%has_field_base = .FALSE.
+   pt_field%has_enabled = .FALSE.
+   Pt_field%solved_field_ref=.FALSE.
+   Pt_field%has_axis=.FALSE.
+   Pt_field%has_grid=.FALSE.
+      
+   IF (PRESENT(Id)) THEN
+     Pt_field%id=TRIM(ADJUSTL(Id))
+     Pt_field%has_id=.TRUE.
+     CALL vector_field__set_new(field_Ids,Pt_field,Pos)
+     CALL sorted_list__Add(Ids,hash(id),Pos)
+   ENDIF
+   
+ END SUBROUTINE field__new
+
+
+ SUBROUTINE field__set(p_field, name, ref, description, unit, operation, freq_op, axis_ref, grid_ref, prec, level, enabled)
+
+    TYPE(field), pointer :: p_field
+    CHARACTER(len=*), OPTIONAL :: name
+    CHARACTER(len=*), OPTIONAL :: ref
+    CHARACTER(len=*), OPTIONAL  :: description
+    CHARACTER(len=*), OPTIONAL  :: unit
+    CHARACTER(len=*), OPTIONAL :: operation
+    INTEGER, OPTIONAL  :: freq_op
+    CHARACTER(len=*),OPTIONAL :: axis_ref
+    CHARACTER(len=*),OPTIONAL :: grid_ref
+    INTEGER, OPTIONAL :: prec
+    INTEGER, OPTIONAL :: level
+    LOGICAL, OPTIONAL :: enabled
+
+    IF (PRESENT(name)) THEN
+        p_field%name=TRIM(ADJUSTL(name))
+        p_field%has_name = .TRUE.
+    ENDIF
+    IF (PRESENT(ref)) THEN
+        p_field%field_ref=TRIM(ADJUSTL(ref))
+        p_field%has_field_ref = .TRUE.
+    ENDIF
+    IF (PRESENT(description)) THEN
+        p_field%description=TRIM(ADJUSTL(description))
+        p_field%has_description = .TRUE.
+    ENDIF
+ 
+    IF (PRESENT(unit)) then
+        p_field%unit=TRIM(ADJUSTL(unit))
+        p_field%has_unit = .TRUE.
+    ENDIF
+    IF (PRESENT(operation)) THEN
+        p_field%operation=TRIM(ADJUSTL(operation))
+        p_field%has_operation = .TRUE.
+    ENDIF
+    IF (PRESENT(freq_op)) THEN
+        p_field%freq_op=freq_op
+        p_field%has_freq_op = .TRUE.
+    ENDIF
+    IF (PRESENT(axis_ref)) THEN
+        p_field%axis_ref=TRIM(ADJUSTL(axis_ref))
+        p_field%has_axis_ref = .TRUE.
+    ENDIF
+    IF (PRESENT(grid_ref)) THEN
+        p_field%grid_ref=TRIM(ADJUSTL(grid_ref))
+        p_field%has_grid_ref = .TRUE.
+    ENDIF
+    IF (PRESENT(prec)) then
+        p_field%prec=prec
+        p_field%has_prec = .TRUE.
+    ENDIF
+    
+    IF (PRESENT(level)) then
+        p_field%level=level
+        p_field%has_level = .TRUE.
+    ENDIF
+
+    IF (PRESENT(enabled)) then
+        p_field%enabled=enabled
+        p_field%has_enabled = .TRUE.
+    ENDIF
+
+  END SUBROUTINE field__set
+
+
+  SUBROUTINE field__print(pt_field)
+
+    TYPE(field), POINTER :: pt_field
+    
+    PRINT *,"--- FIELD ---"
+
+    IF (pt_field%has_id) THEN
+        PRINT *, 'id : ',TRIM(pt_field%id)
+    ELSE
+        PRINT *, 'id undefined '
+    ENDIF
+
+    IF (pt_field%has_name) THEN
+        PRINT *, 'name : ',TRIM(pt_field%name)
+    ELSE
+        PRINT *, 'name undefined '
+    ENDIF
+    IF (pt_field%has_description) THEN
+        PRINT *, 'description : ',TRIM(pt_field%description)
+    ELSE
+        PRINT *, 'description undefined '
+    ENDIF
+    IF (pt_field%has_unit) THEN
+        PRINT *, 'unit : ',TRIM(pt_field%unit)
+    ELSE
+        PRINT *, 'unit undefined '
+    ENDIF
+    IF (pt_field%has_operation) THEN
+        PRINT *, 'operation ',TRIM(pt_field%operation)
+    ELSE
+        PRINT *, 'operation undefined '
+    ENDIF
+    IF (pt_field%has_freq_op) THEN
+        PRINT *, 'freq_op ',pt_field%freq_op
+    ELSE
+        PRINT *, 'freq_op undefined '
+    ENDIF
+
+    IF (pt_field%has_axis_ref) THEN
+        PRINT *, 'axis_ref : ',TRIM(pt_field%axis_ref)
+    ELSE
+        PRINT *, 'axis_ref undefined '
+    ENDIF
+
+    IF (pt_field%has_grid_ref) THEN
+        PRINT *, 'grid_ref : ',TRIM(pt_field%grid_ref)
+    ELSE
+        PRINT *, 'grid_ref undefined '
+    ENDIF
+    
+    IF (pt_field%has_field_ref) THEN
+        PRINT *, 'field_ref : ',TRIM(pt_field%field_ref)
+    ELSE
+        PRINT *, 'field_ref undefined '
+    ENDIF
+
+!    call vert_axis__print(pt_field%p_vert_axis)
+!
+!    IF (pt_field%is_vert_axis_ref_def) THEN
+!        PRINT *, 'pt_field%vert_axis_ref ',TRIM(pt_field%vert_axis_ref)
+!    ELSE
+!        PRINT *, 'pt_field%vert_axis_ref undefined '
+!    ENDIF
+    IF (pt_field%has_prec) THEN
+        PRINT *, 'prec ',pt_field%prec
+    ELSE
+        PRINT *, 'prec undefined '
+    ENDIF
+    IF (pt_field%has_level) then
+        PRINT *, 'level ',pt_field%level
+    ELSE
+        PRINT *, 'level undefined '
+    ENDIF
+    IF (pt_field%has_field_base) THEN
+        PRINT *, 'field_base :',TRIM(Pt_field%field_base%id)
+    ELSE
+        PRINT *, 'field_base indefini'
+    ENDIF
+
+    IF (pt_field%has_enabled) THEN
+        PRINT *, 'enabled : ',pt_field%enabled
+    ELSE
+        PRINT *, 'enabled indefini'
+    ENDIF
+ 
+    PRINT *,"------------"
+    
+  END SUBROUTINE field__print
+
+!  SUBROUTINE field__resolve_ref_vert_axis(p_field)
+!
+!    TYPE(field), POINTER :: p_field
+!    CHARACTER(len=str_len) :: name
+!
+!    IF (p_field%is_vert_axis_ref_def) THEN
+!        name=p_field%vert_axis_ref
+!        IF (vert_axis_def__is_exist(name)) THEN
+!            CALL vert_axis_def__get(name,p_field%p_vert_axis)
+!            p_field%is_vert_axis_def = .TRUE.
+!        ENDIF
+!    ENDIF
+!
+!  END SUBROUTINE field__resolve_ref_vert_axis
+
+  SUBROUTINE field__apply_default(pt_field_default, pt_field_in, pt_field_out)
+
+    TYPE(field), POINTER :: pt_field_default, pt_field_in, pt_field_out
+
+    IF (pt_field_in%has_name) THEN
+        pt_field_out%name=pt_field_in%name
+        pt_field_out%has_name=.TRUE.
+    ELSE IF ( pt_field_default%has_name) THEN
+        pt_field_out%name=pt_field_default%name
+        pt_field_out%has_name=.TRUE.
+    ELSE
+        pt_field_out%has_name=.FALSE.
+    ENDIF
+        
+    IF (pt_field_in%has_description) THEN
+        pt_field_out%description=pt_field_in%description
+        pt_field_out%has_description=.TRUE.
+    ELSE IF ( pt_field_default%has_description ) THEN
+        pt_field_out%description=pt_field_default%description
+        pt_field_out%has_description=.TRUE.
+    ELSE
+        pt_field_out%has_description=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_unit) THEN
+        pt_field_out%unit=pt_field_in%unit
+        pt_field_out%has_unit=.TRUE.
+    ELSE IF ( pt_field_default%has_unit ) THEN
+        pt_field_out%unit=pt_field_default%unit
+        pt_field_out%has_unit=.TRUE.
+    ELSE
+        pt_field_out%has_unit=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_operation) THEN
+        pt_field_out%operation=pt_field_in%operation
+        pt_field_out%has_operation=.TRUE.
+    ELSE IF ( pt_field_default%has_operation ) THEN
+        pt_field_out%operation=pt_field_default%operation
+        pt_field_out%has_operation=.TRUE.
+    ELSE
+        pt_field_out%has_operation=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_freq_op) THEN
+        pt_field_out%freq_op=pt_field_in%freq_op
+        pt_field_out%has_freq_op=.TRUE.
+    ELSE IF ( pt_field_default%has_freq_op ) THEN
+        pt_field_out%freq_op=pt_field_default%freq_op
+        pt_field_out%has_freq_op=.TRUE.
+    ELSE
+        pt_field_out%has_freq_op=.FALSE.
+    ENDIF
+
+!    IF (pt_field_in%has_axis) THEN
+!        pt_field_out%p_axis => pt_field_in%p_axis
+!        pt_field_out%has_axis=.TRUE.
+!    ELSE IF ( pt_field_default%has_axis ) THEN
+!        pt_field_out%p_axis => pt_field_default%p_axis
+!        pt_field_out%has_axis=.TRUE.
+!    ELSE
+!        pt_field_out%has_axis=.FALSE.
+!    ENDIF
+    
+    IF (pt_field_in%has_axis_ref) THEN
+        pt_field_out%axis_ref=pt_field_in%axis_ref
+        pt_field_out%has_axis_ref=.TRUE.
+    ELSE IF ( pt_field_default%has_axis_ref ) THEN
+        pt_field_out%axis_ref=pt_field_default%axis_ref
+        pt_field_out%has_axis_ref=.TRUE.
+    ELSE
+        pt_field_out%has_axis_ref=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_grid_ref) THEN
+        pt_field_out%grid_ref=pt_field_in%grid_ref
+        pt_field_out%has_grid_ref=.TRUE.
+    ELSE IF ( pt_field_default%has_grid_ref ) THEN
+        pt_field_out%grid_ref=pt_field_default%grid_ref
+        pt_field_out%has_grid_ref=.TRUE.
+    ELSE
+        pt_field_out%has_grid_ref=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_prec) THEN
+        pt_field_out%prec=pt_field_in%prec
+        pt_field_out%has_prec=.TRUE.
+    ELSE IF ( pt_field_default%has_prec ) THEN
+        pt_field_out%prec=pt_field_default%prec
+        pt_field_out%has_prec=.TRUE.
+    ELSE
+        pt_field_out%has_prec=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_level) THEN
+        pt_field_out%level=pt_field_in%level
+        pt_field_out%has_level=.TRUE.
+    ELSE IF ( pt_field_default%has_level ) THEN
+        pt_field_out%level=pt_field_default%level
+        pt_field_out%has_level=.TRUE.
+    ELSE
+        pt_field_out%has_level=.FALSE.
+    ENDIF
+
+    IF (pt_field_in%has_enabled) THEN
+        pt_field_out%enabled=pt_field_in%enabled
+        pt_field_out%has_enabled=.TRUE.
+    ELSE IF ( pt_field_default%has_enabled ) THEN
+        pt_field_out%enabled=pt_field_default%enabled
+        pt_field_out%has_enabled=.TRUE.
+    ELSE
+        pt_field_out%has_enabled=.FALSE.
+    ENDIF
+    
+  END SUBROUTINE field__apply_default
+
+!  FUNCTION field__is_vert_axis_attached(p_field, vert_axis_name)
+!
+!    LOGICAL :: field__is_vert_axis_attached
+!    TYPE(field), POINTER :: p_field
+!    CHARACTER(len=*), INTENT(IN) :: vert_axis_name
+!
+!    field__is_vert_axis_attached = .false.
+!    IF (p_field%is_vert_axis_def) THEN
+!        IF (vert_axis_name == p_field%p_vert_axis%name) field__is_vert_axis_attached = .TRUE.
+!    ENDIF
+!
+!  END FUNCTION field__is_vert_axis_attached
+
+  RECURSIVE SUBROUTINE field__solve_field_ref(pt_field)
+  USE error_msg
+  IMPLICIT NONE
+    TYPE(field), POINTER :: pt_field
+    
+    TYPE(field), POINTER :: field_ref
+    
+    IF (.NOT. pt_field%solved_field_ref) THEN
+      
+      IF (pt_field%has_field_ref) THEN
+      
+        CALL field__get(pt_field%field_ref,field_ref)
+      
+        IF (.NOT. ASSOCIATED(field_ref)) THEN
+          WRITE (message,*) "The field : id = ",pt_field%id,"  name = ",Pt_field%name,   &
+                        " has a unknown reference to field : id =",pt_field%field_ref
+          CALL error("field__solve_field_ref")
+        ENDIF
+      
+        CALL field__get_field_base(field_ref,pt_field%field_base) 
+        Pt_field%has_field_base=.TRUE.
+        
+        CALL field__apply_default(field_ref,pt_field,pt_field)
+        
+          
+      ELSE 
+
+        IF (pt_field%has_id) THEN
+          pt_field%field_base=>pt_field
+        ENDIF
+      
+      ENDIF
+      
+      IF (.NOT. pt_field%has_name) THEN
+        IF (pt_field%has_id) THEN
+          pt_field%name=pt_field%id
+          pt_field%has_name=.TRUE.
+        ENDIF
+      ENDIF
+    
+      Pt_field%solved_field_ref=.TRUE.
+    
+    ENDIF
+    
+  END SUBROUTINE field__solve_field_ref
+  
+
+  RECURSIVE SUBROUTINE field__get_field_base(pt_field,pt_field_base)
+  IMPLICIT NONE
+    TYPE(field), POINTER :: pt_field
+    TYPE(field), POINTER :: pt_field_base
+    
+     
+    IF (.NOT. Pt_field%solved_field_ref) THEN
+      CALL field__solve_field_ref(Pt_field)
+    ENDIF
+     
+    IF (pt_field%has_field_base) THEN
+      pt_field_base=>pt_field%field_base
+    ELSE
+      pt_field_base=>pt_field
+    ENDIF
+   
+ END SUBROUTINE field__get_field_base
+
+ SUBROUTINE field__solve_axis_ref(pt_field)
+ USE error_msg
+ IMPLICIT NONE
+   TYPE(field), POINTER :: pt_field
+   
+   IF (pt_field%has_axis_ref) THEN
+     CALL axis__get(pt_field%axis_ref,pt_field%axis)
+     IF (ASSOCIATED(pt_field%axis)) THEN
+       pt_field%has_axis=.TRUE.
+     ELSE
+       WRITE (message,*) "The field : id = ",pt_field%id,"  name = ",Pt_field%name,   &
+                        " has a unknown reference to axis : id =",pt_field%axis_ref
+       CALL error("mod_field::field__solve_axis_ref")
+     ENDIF
+   ENDIF
+   
+ END SUBROUTINE field__solve_axis_ref
+   
+ SUBROUTINE field__solve_grid_ref(pt_field)
+ USE error_msg
+ IMPLICIT NONE
+   TYPE(field), POINTER :: pt_field
+   
+   IF (pt_field%has_grid_ref) THEN
+     CALL grid__get(pt_field%grid_ref,pt_field%grid)
+     IF (ASSOCIATED(pt_field%grid)) THEN
+       pt_field%has_grid=.TRUE.
+     ELSE
+       WRITE (message,*) "The field : id = ",pt_field%id,"  name = ",Pt_field%name,   &
+                        " has a unknown reference to grid : id =",pt_field%grid_ref
+       CALL error("mod_field::field__solve_grid_ref")
+     ENDIF
+   ENDIF
+   
+ END SUBROUTINE field__solve_grid_ref
+   
+
+   
+END MODULE mod_field
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_field_definition.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_field_definition.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_field_definition.f90	(revision 8)
@@ -0,0 +1,18 @@
+MODULE mod_field_definition
+  USE mod_field_group
+  
+  TYPE(field_group),SAVE,POINTER :: field_definition
+ 
+CONTAINS
+
+  SUBROUTINE field_definition__Init
+  USE mod_field_group
+  IMPLICIT NONE
+  
+    ALLOCATE(field_definition)
+    CALL field_group__new(field_definition,"field_definition")
+    
+  END SUBROUTINE field_definition__Init
+        
+END MODULE mod_field_definition
+
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_field_group.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_field_group.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_field_group.f90	(revision 8)
@@ -0,0 +1,233 @@
+MODULE mod_field_group
+
+  USE mod_field
+  USE mod_xmlio_parameters
+
+  IMPLICIT NONE
+
+  TYPE field_group
+    CHARACTER(LEN=str_len)                    :: id
+    LOGICAL                                   :: has_id
+    TYPE(vector_field_group), POINTER         :: groups
+    TYPE(vector_field),POINTER                :: fields     
+    TYPE(field), POINTER                      :: default_attribut
+  END TYPE field_group
+
+  INCLUDE "vector_field_group_def.inc"  
+
+  TYPE(vector_field_group),POINTER      :: field_group_Ids
+  TYPE(sorted_list),POINTER,PRIVATE     :: Ids 
+
+CONTAINS
+
+  INCLUDE "vector_field_group_contains.inc"
+
+  SUBROUTINE field_group__init
+  IMPLICIT NONE
+    
+    ALLOCATE(field_group_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_field_group__new(field_group_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE field_group__init
+
+  SUBROUTINE field_group__get(Id,Pt_fg)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(field_group),POINTER       :: Pt_fg
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_fg=>field_group_ids%at(Pos)%Pt
+    ELSE
+      Pt_fg=>NULL()
+    ENDIF
+    
+  END SUBROUTINE field_group__get
+    
+  RECURSIVE SUBROUTINE field_group__new(Pt_fg,Id)
+  USE string_function
+  IMPLICIT NONE
+    TYPE(field_group),POINTER                :: Pt_fg
+    CHARACTER(LEN=*),OPTIONAL,INTENT(IN)     :: Id
+    
+    INTEGER :: Pos
+    
+    ALLOCATE(Pt_fg%groups)
+    ALLOCATE(Pt_fg%fields)
+    ALLOCATE(Pt_fg%default_attribut)
+    
+    CALL vector_field_group__new(Pt_fg%groups)
+    CALL vector_field__new(Pt_fg%fields)
+    CALL field__new(Pt_fg%default_attribut)
+    Pt_fg%has_id=.FALSE.
+      
+    IF (PRESENT(Id)) THEN
+      Pt_fg%id=TRIM(Id)
+      Pt_fg%has_id=.TRUE.
+      CALL vector_field_group__set_new(field_group_Ids,Pt_fg,Pos)
+      CALL sorted_list__Add(Ids,hash(id),Pos)
+    ENDIF
+
+  END SUBROUTINE field_group__new
+
+      
+  SUBROUTINE field_group__get_new_group(Pt_fg,Pt_fg_out,Id)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER            :: Pt_fg
+    TYPE(field_group),POINTER            :: Pt_fg_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_field_group__get_new(Pt_fg%groups,Pt_fg_out)
+ 
+    IF (PRESENT(id)) THEN
+      CALL field_group__new(Pt_fg_out,Id)
+    ELSE
+      CALL field_group__new(Pt_fg_out)
+    ENDIF
+    
+  END SUBROUTINE field_group__get_new_group
+
+  
+  SUBROUTINE field_group__get_new_field(Pt_fg,Pt_f_out,Id)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER            :: Pt_fg
+    TYPE(field),POINTER                  :: Pt_f_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_field__get_new(Pt_fg%fields,Pt_f_out)
+    
+    IF (PRESENT(id)) THEN
+      CALL field__new(Pt_f_out,Id)
+    ELSE
+      CALL field__new(Pt_f_out)
+    ENDIF
+    
+  END SUBROUTINE field_group__get_new_field
+  
+  
+  SUBROUTINE field_group__get_default_attribut(Pt_fg,Pt_f)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+    TYPE(field),POINTER        :: Pt_f
+    
+    Pt_f=>Pt_fg%default_attribut
+  END SUBROUTINE field_group__get_default_attribut
+
+  
+  RECURSIVE SUBROUTINE field_group__apply_default(Pt_fg,default)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER           :: Pt_fg
+    TYPE(field),POINTER,OPTIONAL        :: default
+    
+    INTEGER :: i
+    
+    IF (PRESENT(default)) THEN
+      CALL field__apply_default(default,Pt_fg%default_attribut,Pt_fg%default_attribut)
+    ENDIF
+      
+    DO i=1,Pt_fg%groups%size
+      CALL field_group__apply_default(Pt_fg%groups%at(i)%pt,Pt_fg%default_attribut)
+    ENDDO
+    
+    DO i=1,Pt_fg%fields%size
+      CALL field__apply_default(Pt_fg%default_attribut,Pt_fg%fields%at(i)%pt,Pt_fg%fields%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE field_group__apply_default
+  
+  SUBROUTINE field_group__solve_ref(pt_fg)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+
+    CALL field_group__solve_field_ref(Pt_fg)
+    CALL field_group__solve_axis_ref(Pt_fg)
+    CALL field_group__solve_grid_ref(Pt_fg)
+
+  END SUBROUTINE  field_group__solve_ref
+     
+  RECURSIVE SUBROUTINE field_group__solve_field_ref(Pt_fg)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+    
+    INTEGER :: i
+
+    DO i=1,Pt_fg%groups%size
+      CALL field_group__solve_field_ref(Pt_fg%groups%at(i)%pt)
+    ENDDO
+    
+    DO i=1,Pt_fg%fields%size
+      CALL field__solve_field_ref(Pt_fg%fields%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE field_group__solve_field_ref
+
+  RECURSIVE SUBROUTINE field_group__solve_axis_ref(Pt_fg)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+    
+    INTEGER :: i
+
+    DO i=1,Pt_fg%groups%size
+      CALL field_group__solve_axis_ref(Pt_fg%groups%at(i)%pt)
+    ENDDO
+    
+    DO i=1,Pt_fg%fields%size
+      CALL field__solve_axis_ref(Pt_fg%fields%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE field_group__solve_axis_ref
+
+  RECURSIVE SUBROUTINE field_group__solve_grid_ref(Pt_fg)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+     
+    INTEGER :: i
+ 
+    DO i=1,Pt_fg%groups%size
+      CALL field_group__solve_grid_ref(Pt_fg%groups%at(i)%pt)
+    ENDDO
+       
+    DO i=1,Pt_fg%fields%size
+      CALL field__solve_grid_ref(Pt_fg%fields%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE field_group__solve_grid_ref
+  
+  RECURSIVE SUBROUTINE field_group__print(Pt_fg)
+  IMPLICIT NONE
+    TYPE(field_group),POINTER  :: Pt_fg
+   
+    INTEGER :: i
+    
+    PRINT *,"--- FIELD GROUP ---"
+    IF (Pt_fg%has_id) THEN
+      PRINT *,"id :",TRIM(Pt_fg%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    PRINT *,"field default attribut :"
+    CALL field__print(Pt_fg%default_attribut)    
+
+    PRINT *,"owned field groups :",Pt_fg%groups%size      
+    DO i=1,Pt_fg%groups%size
+      CALL field_group__print(Pt_fg%groups%at(i)%pt)
+    ENDDO
+
+    PRINT *,"owned field :",Pt_fg%fields%size      
+    DO i=1,Pt_fg%fields%size
+      CALL field__print(Pt_fg%fields%at(i)%pt)
+    ENDDO
+    
+    PRINT *,"------------"
+    
+  END SUBROUTINE field_group__print     
+
+END MODULE mod_field_group
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_file.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_file.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_file.f90	(revision 8)
@@ -0,0 +1,266 @@
+MODULE mod_file
+
+  USE mod_xmlio_parameters
+  USE mod_field_group
+  USE mod_sorted_list
+
+  TYPE, PUBLIC :: file
+    CHARACTER(len=str_len)           :: id
+    LOGICAL                          :: has_id
+    CHARACTER(len=str_len)           :: name
+    LOGICAL                          :: has_name
+    CHARACTER(len=str_len)           :: description
+    LOGICAL                          :: has_description
+    INTEGER                          :: output_freq
+    LOGICAL                          :: has_output_freq
+    INTEGER                          :: output_level
+    LOGICAL                          :: has_output_level
+    LOGICAL                          :: enabled
+    LOGICAL                          :: has_enabled
+    INTEGER                          :: internal(internal_file)
+    TYPE(field_group),POINTER        :: field_list 
+  END TYPE file
+
+  INCLUDE 'vector_file_def.inc'
+  
+  TYPE(vector_file),POINTER,SAVE             :: file_Ids
+  TYPE(sorted_list),POINTER,SAVE,PRIVATE     :: Ids 
+
+CONTAINS
+  INCLUDE 'vector_file_contains.inc'
+
+  SUBROUTINE file__init
+  IMPLICIT NONE
+    
+    ALLOCATE(file_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_file__new(file_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE file__init
+  
+  SUBROUTINE file__get(Id,Pt_file)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(file),POINTER              :: Pt_file
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_file=>file_ids%at(Pos)%Pt
+    ELSE
+      Pt_file=>NULL()
+    ENDIF
+    
+  END SUBROUTINE file__get
+  
+  SUBROUTINE file__new(pt_file,Id)
+  USE string_function
+  IMPLICIT NONE
+   TYPE(file), POINTER           :: pt_file
+   CHARACTER(LEN=*),OPTIONAL     :: Id
+   INTEGER                       :: Pos
+
+   ALLOCATE(pt_file%field_list)
+   CALL field_group__new(pt_file%field_list)
+      
+   pt_file%has_id           = .FALSE.
+   pt_file%has_name         = .FALSE.
+   pt_file%has_description  = .FALSE.
+   pt_file%has_output_freq  = .FALSE.
+   pt_file%has_output_level = .FALSE.
+   pt_file%has_output_level = .FALSE.
+   
+   IF (PRESENT(Id)) THEN
+     Pt_file%id=TRIM(ADJUSTL(Id))
+     Pt_file%has_id=.TRUE.
+     CALL vector_file__set_new(file_Ids,Pt_file,Pos)
+     CALL sorted_list__Add(Ids,hash(id),Pos)
+   ENDIF
+
+  END SUBROUTINE file__new
+
+  SUBROUTINE file__set(pt_file, name, description, output_freq, output_level,enabled)
+  IMPLICIT NONE
+    TYPE(file), POINTER         :: pt_file
+    CHARACTER(len=*)  ,OPTIONAL :: name
+    CHARACTER(len=*)  ,OPTIONAL :: description
+    INTEGER           ,OPTIONAL :: output_freq
+    INTEGER           ,OPTIONAL :: output_level
+    LOGICAL           ,OPTIONAL :: enabled
+
+    IF (PRESENT(name)) THEN
+        pt_file%name=TRIM(ADJUSTL(name))
+        pt_file%has_name = .TRUE.
+    ENDIF
+
+    IF (PRESENT(description)) THEN
+        pt_file%description=TRIM(ADJUSTL(description))
+        pt_file%has_description = .TRUE.
+    ENDIF
+ 
+    IF (PRESENT(output_freq)) then
+        pt_file%output_freq=output_freq
+        pt_file%has_output_freq = .TRUE.
+    ENDIF
+
+    IF (PRESENT(output_level)) then
+        pt_file%output_level = output_level
+        pt_file%has_output_level = .TRUE.
+    ENDIF
+
+    IF (PRESENT(enabled)) then
+        pt_file%enabled = enabled
+        pt_file%has_enabled = .TRUE.
+    ENDIF
+    
+  END SUBROUTINE file__set
+
+  SUBROUTINE file__get_field_list(pt_file,pt_field_list)
+  IMPLICIT NONE
+    TYPE(file),POINTER         :: pt_file
+    TYPE(field_group),POINTER  :: pt_field_list
+    
+      pt_field_list=>pt_file%field_list
+  
+  END SUBROUTINE file__get_field_list
+    
+  SUBROUTINE file__print(pt_file)
+  IMPLICIT NONE
+    TYPE(file), POINTER         :: pt_file
+
+    PRINT *,"---- FILE ----"
+    IF (pt_file%has_id) THEN
+      PRINT *,"id = ",TRIM(pt_file%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    IF (pt_file%has_name) THEN
+      PRINT *,"name = ",TRIM(pt_file%name)
+    ELSE
+      PRINT *,"name undefined"
+    ENDIF
+    
+    IF (pt_file%has_description) THEN
+      PRINT *,"description = ",TRIM(pt_file%description)
+    ELSE
+      PRINT *,"description undefined"
+    ENDIF
+ 
+    IF (pt_file%has_output_freq) THEN
+      PRINT *,"output_freq = ",pt_file%output_freq
+    ELSE
+      PRINT *,"output_freq undefined"
+    ENDIF
+
+    IF (pt_file%has_output_level) THEN
+      PRINT *,"output_level = ",pt_file%output_level
+    ELSE
+      PRINT *,"output_level undefined"
+    ENDIF
+
+    IF (pt_file%has_enabled) THEN
+      PRINT *,"enabled = ",pt_file%enabled
+    ELSE
+      PRINT *,"enabled undefined"
+    ENDIF
+
+    PRINT *,"field_list :"
+    CALL field_group__print(pt_file%field_list)
+
+    PRINT *,"--------------"
+
+  END SUBROUTINE file__print
+
+
+  SUBROUTINE file__apply_default(pt_file_default, pt_file_in, pt_file_out)
+
+    TYPE(file), POINTER :: pt_file_default, pt_file_in, pt_file_out
+
+    IF (pt_file_in%has_name) THEN
+        pt_file_out%name=pt_file_in%name
+        pt_file_out%has_name=.TRUE.
+    ELSE IF ( pt_file_default%has_name) THEN
+        pt_file_out%name=pt_file_default%name
+        pt_file_out%has_name=.TRUE.
+    ELSE
+        pt_file_out%has_name=.FALSE.
+    ENDIF
+        
+    IF (pt_file_in%has_description) THEN
+        pt_file_out%description=pt_file_in%description
+        pt_file_out%has_description=.TRUE.
+    ELSE IF ( pt_file_default%has_description ) THEN
+        pt_file_out%description=pt_file_default%description
+        pt_file_out%has_description=.TRUE.
+    ELSE
+        pt_file_out%has_description=.FALSE.
+    ENDIF
+
+    IF (pt_file_in%has_output_freq) THEN
+        pt_file_out%output_freq=pt_file_in%output_freq
+        pt_file_out%has_output_freq=.TRUE.
+    ELSE IF ( pt_file_default%has_output_freq ) THEN
+        pt_file_out%output_freq=pt_file_default%output_freq
+        pt_file_out%has_output_freq=.TRUE.
+    ELSE
+        pt_file_out%has_output_freq=.FALSE.
+    ENDIF
+
+    IF (pt_file_in%has_output_level) THEN
+        pt_file_out%output_level=pt_file_in%output_level
+        pt_file_out%has_output_level=.TRUE.
+    ELSE IF ( pt_file_default%has_output_level ) THEN
+        pt_file_out%output_level=pt_file_default%output_level
+        pt_file_out%has_output_level=.TRUE.
+    ELSE
+        pt_file_out%has_output_level=.FALSE.
+    ENDIF
+
+    IF (pt_file_in%has_enabled) THEN
+        pt_file_out%enabled=pt_file_in%enabled
+        pt_file_out%has_enabled=.TRUE.
+    ELSE IF ( pt_file_default%has_enabled ) THEN
+        pt_file_out%enabled=pt_file_default%enabled
+        pt_file_out%has_enabled=.TRUE.
+    ELSE
+        pt_file_out%has_enabled=.FALSE.
+    ENDIF
+    
+    CALL field_group__apply_default(pt_file_out%field_list)
+
+
+  END SUBROUTINE file__apply_default
+
+   
+  SUBROUTINE file__solve_field_ref(pt_file)
+  IMPLICIT NONE
+    TYPE(file), POINTER :: pt_file
+    
+    CALL field_group__solve_ref(pt_file%field_list)
+  
+  END SUBROUTINE file__solve_field_ref
+  
+  
+  SUBROUTINE file__Check(pt_file)
+  USE error_msg
+  IMPLICIT NONE
+    TYPE(file), POINTER :: pt_file
+      
+    IF (.NOT. pt_file%has_name) THEN
+      IF (pt_file%has_id) THEN
+        pt_file%name=TRIM(pt_file%id)
+      ELSE
+        WRITE(message,*) "File has no name and no id" 
+        CALL error("mod_file::file__check")
+      ENDIF 
+    ENDIF
+ 
+ END SUBROUTINE file__Check
+    
+END MODULE mod_file
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_file_definition.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_file_definition.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_file_definition.f90	(revision 8)
@@ -0,0 +1,17 @@
+MODULE mod_file_definition
+  USE mod_file_group
+  
+  TYPE(file_group),SAVE,POINTER :: file_definition
+  
+CONTAINS
+
+  SUBROUTINE file_definition__Init
+  USE mod_file_group
+  IMPLICIT NONE
+  
+    ALLOCATE(file_definition)
+    CALL file_group__new(file_definition,"file_definition")
+    
+  END SUBROUTINE file_definition__Init
+        
+END MODULE mod_file_definition
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_file_group.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_file_group.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_file_group.f90	(revision 8)
@@ -0,0 +1,202 @@
+MODULE mod_file_group
+  USE mod_file
+  USE mod_xmlio_parameters
+
+  IMPLICIT NONE
+
+  TYPE file_group
+    CHARACTER(LEN=str_len)                    :: id
+    LOGICAL                                   :: has_id
+    TYPE(vector_file_group), POINTER          :: groups
+    TYPE(vector_file),POINTER                 :: files     
+    TYPE(file), POINTER                       :: default_attribut
+  END TYPE file_group
+
+  INCLUDE "vector_file_group_def.inc"  
+
+  TYPE(vector_file_group),POINTER       :: file_group_Ids
+  TYPE(sorted_list),POINTER,PRIVATE     :: Ids 
+
+CONTAINS
+
+  INCLUDE "vector_file_group_contains.inc"
+
+  SUBROUTINE file_group__init
+  IMPLICIT NONE
+    
+    ALLOCATE(file_group_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_file_group__new(file_group_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE file_group__init
+
+  SUBROUTINE file_group__get(Id,Pt_fg)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(file_group),POINTER        :: Pt_fg
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_fg=>file_group_ids%at(Pos)%Pt
+    ELSE
+      Pt_fg=>NULL()
+    ENDIF
+    
+  END SUBROUTINE file_group__get
+    
+  RECURSIVE SUBROUTINE file_group__new(Pt_fg,Id)
+  USE string_function
+  IMPLICIT NONE
+    TYPE(file_group),POINTER                :: Pt_fg
+    CHARACTER(LEN=*),OPTIONAL,INTENT(IN)     :: Id
+    
+    INTEGER :: Pos
+    
+    ALLOCATE(Pt_fg%groups)
+    ALLOCATE(Pt_fg%files)
+    ALLOCATE(Pt_fg%default_attribut)
+    
+    CALL vector_file_group__new(Pt_fg%groups)
+    CALL vector_file__new(Pt_fg%files)
+    CALL file__new(Pt_fg%default_attribut)
+    Pt_fg%has_id=.FALSE.
+      
+    IF (PRESENT(Id)) THEN
+      Pt_fg%id=TRIM(Id)
+      Pt_fg%has_id=.TRUE.
+      CALL vector_file_group__set_new(file_group_Ids,Pt_fg,Pos)
+      CALL sorted_list__Add(Ids,hash(id),Pos)
+    ENDIF
+
+  END SUBROUTINE file_group__new
+
+      
+  SUBROUTINE file_group__get_new_group(Pt_fg,Pt_fg_out,Id)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER             :: Pt_fg
+    TYPE(file_group),POINTER             :: Pt_fg_out
+    CHARACTER(LEN=str_len),OPTIONAL      :: Id
+    
+    CALL vector_file_group__get_new(Pt_fg%groups,Pt_fg_out)
+    CALL file_group__new(Pt_fg_out)
+
+    IF (PRESENT(id)) THEN
+      CALL file_group__new(Pt_fg_out,Id)
+    ELSE
+      CALL file_group__new(Pt_fg_out)
+    ENDIF
+    
+  END SUBROUTINE file_group__get_new_group
+
+  
+  SUBROUTINE file_group__get_new_file(Pt_fg,Pt_f_out,Id)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER            :: Pt_fg
+    TYPE(file),POINTER                  :: Pt_f_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_file__get_new(Pt_fg%files,Pt_f_out)
+    
+    IF (PRESENT(id)) THEN
+      CALL file__new(Pt_f_out,Id)
+    ELSE
+      CALL file__new(Pt_f_out)
+    ENDIF
+    
+  END SUBROUTINE file_group__get_new_file
+  
+  
+  SUBROUTINE file_group__get_default_attribut(Pt_fg,Pt_f)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER  :: Pt_fg
+    TYPE(file),POINTER        :: Pt_f
+    
+    Pt_f=>Pt_fg%default_attribut
+  END SUBROUTINE file_group__get_default_attribut
+  
+  RECURSIVE SUBROUTINE file_group__apply_default(Pt_fg,default)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER  :: Pt_fg
+    TYPE(file),POINTER,OPTIONAL        :: default
+    
+    INTEGER :: i
+    
+    IF (PRESENT(default)) THEN
+      CALL file__apply_default(default,Pt_fg%default_attribut,Pt_fg%default_attribut)
+    ENDIF
+      
+    DO i=1,Pt_fg%groups%size
+      CALL file_group__apply_default(Pt_fg%groups%at(i)%pt,Pt_fg%default_attribut)
+    ENDDO
+    
+    DO i=1,Pt_fg%files%size
+      CALL file__apply_default(Pt_fg%default_attribut,Pt_fg%files%at(i)%pt,Pt_fg%files%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE file_group__apply_default
+
+  SUBROUTINE file_group__solve_field_ref(pt_fg)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER  :: Pt_fg
+
+    INTEGER :: i
+    
+    DO i=1,Pt_fg%files%size
+      CALL file__solve_field_ref(Pt_fg%files%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE file_group__solve_field_ref
+  
+  
+  RECURSIVE SUBROUTINE file_group__print(Pt_fg)
+  IMPLICIT NONE
+    TYPE(file_group),POINTER  :: Pt_fg
+   
+    INTEGER :: i
+    
+    PRINT *,"--- FILE GROUP ---"
+    IF (Pt_fg%has_id) THEN
+      PRINT *,"id :",TRIM(Pt_fg%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    PRINT *,"file default attribut :"
+    CALL file__print(Pt_fg%default_attribut)    
+
+    PRINT *,"owned file groups :"      
+    DO i=1,Pt_fg%groups%size
+      CALL file_group__print(Pt_fg%groups%at(i)%pt)
+    ENDDO
+
+    PRINT *,"owned file :"      
+    DO i=1,Pt_fg%files%size
+      CALL file__print(Pt_fg%files%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE file_group__print     
+
+  RECURSIVE SUBROUTINE file_group__Check(Pt_fg)
+  IMPLICIT NONE
+  
+    TYPE(file_group),POINTER  :: Pt_fg
+    INTEGER :: i
+   
+    DO i=1,Pt_fg%groups%size
+      CALL file_group__check(pt_fg%groups%at(i)%pt)
+    ENDDO
+
+    DO i=1,Pt_fg%files%size
+      CALL file__check(pt_fg%files%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE file_group__check     
+          
+END MODULE mod_file_group
+
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_grid.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_grid.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_grid.f90	(revision 8)
@@ -0,0 +1,279 @@
+MODULE mod_grid
+  USE mod_xmlio_parameters
+  USE mod_sorted_list
+  USE mod_domain
+  IMPLICIT NONE
+
+  TYPE, PUBLIC :: grid
+    CHARACTER(len=str_len)      :: id
+    LOGICAL                     :: has_id
+    CHARACTER(len=str_len)      :: name
+    LOGICAL                     :: has_name
+    CHARACTER(len=str_len)      :: description
+    LOGICAL                     :: has_description
+    TYPE(domain),POINTER        :: domain
+    TYPE(vector_domain),POINTER :: subdomain
+    TYPE(sorted_list),POINTER   :: rank_ids
+    INTEGER,POINTER             :: ranks(:)
+    INTEGER                     :: ni
+    INTEGER                     :: nj
+    LOGICAL                     :: has_dimension
+  END TYPE grid
+
+  INCLUDE 'vector_grid_def.inc'
+  
+  TYPE(vector_grid),POINTER,SAVE             :: grid_Ids
+  TYPE(sorted_list),POINTER,SAVE,PRIVATE     :: Ids 
+
+CONTAINS
+  INCLUDE 'vector_grid_contains.inc'
+
+  SUBROUTINE grid__init
+  IMPLICIT NONE
+    
+    ALLOCATE(grid_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_grid__new(grid_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE grid__init
+  
+  SUBROUTINE grid__get(Id,Pt_grid)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(grid),POINTER              :: Pt_grid
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_grid=>grid_ids%at(Pos)%Pt
+    ELSE
+      Pt_grid=>NULL()
+    ENDIF
+    
+  END SUBROUTINE grid__get
+  
+  SUBROUTINE grid__new(pt_grid,Id)
+  USE string_function
+  IMPLICIT NONE
+   TYPE(grid), POINTER           :: pt_grid
+   CHARACTER(LEN=*),OPTIONAL     :: Id
+   INTEGER                       :: Pos
+   
+   ALLOCATE(pt_grid%domain)
+   ALLOCATE(pt_grid%subdomain)
+   ALLOCATE(pt_grid%rank_ids)
+   CALL domain__new(pt_grid%domain)
+   CALL vector_domain__new(pt_grid%subdomain)
+   CALL sorted_list__new(pt_grid%rank_ids)
+   
+   pt_grid%has_id          = .FALSE.
+   pt_grid%has_name        = .FALSE.
+   pt_grid%has_description = .FALSE.
+   pt_grid%has_dimension   = .FALSE.
+   
+   IF (PRESENT(Id)) THEN
+     Pt_grid%id=TRIM(ADJUSTL(Id))
+     Pt_grid%has_id=.TRUE.
+     CALL vector_grid__set_new(grid_Ids,Pt_grid,Pos)
+     CALL sorted_list__Add(Ids,hash(id),Pos)
+   ENDIF
+
+ END SUBROUTINE grid__new
+
+  SUBROUTINE grid__set(pt_grid, name, description)
+  IMPLICIT NONE
+    TYPE(grid), POINTER :: pt_grid
+    CHARACTER(len=*)  ,OPTIONAL :: name
+    CHARACTER(len=*)  ,OPTIONAL :: description
+
+    IF (PRESENT(name)) THEN
+        pt_grid%name=TRIM(ADJUSTL(name))
+        pt_grid%has_name = .TRUE.
+    ENDIF
+
+    IF (PRESENT(description)) THEN
+        pt_grid%description=TRIM(ADJUSTL(description))
+        pt_grid%has_description = .TRUE.
+    ENDIF
+
+  END SUBROUTINE grid__set
+
+  SUBROUTINE grid__set_dimension(pt_grid, ni, nj)
+  IMPLICIT NONE
+    TYPE(grid), POINTER   :: pt_grid
+    INTEGER,INTENT(IN)    :: ni
+    INTEGER,INTENT(IN)    :: nj
+    
+    pt_grid%ni=ni
+    pt_grid%nj=nj
+    pt_grid%has_dimension=.TRUE.
+    
+  END SUBROUTINE grid__set_dimension
+    
+
+  SUBROUTINE grid__get_new_subdomain(Pt_grid,rank,pt_domain)
+  IMPLICIT NONE
+    TYPE(grid), POINTER   :: pt_grid
+    INTEGER,INTENT(IN)    :: rank
+    TYPE(domain), POINTER :: Pt_domain
+    
+    INTEGER :: Pos
+    
+    CALL vector_domain__get_new(pt_grid%subdomain,pt_domain,Pos)
+    CALL sorted_list__add(pt_grid%rank_ids,rank,Pos)
+    CALL domain__new(pt_domain)
+    
+  END SUBROUTINE grid__get_new_subdomain    
+
+  SUBROUTINE grid__get_subdomain(Pt_grid,rank,pt_domain)
+  IMPLICIT NONE
+    TYPE(grid), POINTER     :: pt_grid
+    INTEGER,INTENT(IN)      :: rank
+    TYPE(domain), POINTER   :: Pt_domain
+
+    INTEGER    :: rank_id
+    LOGICAL    :: success
+
+    CALL sorted_list__find(pt_grid%rank_ids,rank,rank_id,success)
+    IF (success) THEN
+      pt_domain=>pt_grid%subdomain%at(rank_id)%pt
+    ELSE
+      !! message d'erreur 
+   ENDIF
+
+  END SUBROUTINE grid__get_subdomain
+   
+  SUBROUTINE grid__process_domain(Pt_grid)
+  IMPLICIT NONE
+    TYPE(grid), POINTER  :: pt_grid
+    TYPE(domain),POINTER :: subdomain
+    
+    REAL,ALLOCATABLE :: lon(:,:)
+    REAL,ALLOCATABLE :: lat(:,:)
+    INTEGER :: ib,ie,jb,je,ni,nj,ibegin,jbegin
+    INTEGER :: i
+    
+      ALLOCATE(pt_grid%ranks(0:pt_grid%subdomain%size-1))
+
+      DO i=1,pt_grid%subdomain%size
+        subdomain=>pt_grid%subdomain%at(i)%pt
+        IF (i==1) THEN
+          ib=subdomain%ibegin
+          ie=subdomain%iend   
+          jb=subdomain%jbegin
+          je=subdomain%jend
+        ELSE
+          IF (subdomain%ibegin<ib) ib=subdomain%ibegin
+          IF (subdomain%iend>ie) ie=subdomain%iend
+          IF (subdomain%jbegin<jb) jb=subdomain%jbegin
+          IF (subdomain%jend>je) je=subdomain%jend
+        ENDIF
+        pt_grid%ranks(subdomain%rank)=i
+      ENDDO
+      
+      ni=ie-ib+1
+      nj=je-jb+1
+      ibegin=ib
+      jbegin=jb
+      
+      ALLOCATE(lon(ni,nj))
+      ALLOCATE(lat(ni,nj))
+      
+      DO i=1,pt_grid%subdomain%size
+        subdomain=>pt_grid%subdomain%at(i)%pt
+        ib=subdomain%ibegin-ibegin+1
+        ie=subdomain%iend-ibegin+1   
+        jb=subdomain%jbegin-jbegin+1
+        je=subdomain%jend-jbegin+1
+        lon(ib:ie,jb:je)=subdomain%lon(:,:)
+        lat(ib:ie,jb:je)=subdomain%lat(:,:)
+      ENDDO
+      
+      CALL domain__set(pt_grid%domain,0,ni,nj,ibegin,jbegin,lon,lat)
+
+      
+      DEALLOCATE(lon)
+      DEALLOCATE(lat)
+      
+    END SUBROUTINE grid__process_domain
+      
+            
+        
+  SUBROUTINE grid__print(pt_grid)
+  IMPLICIT NONE
+    TYPE(grid), POINTER  :: pt_grid
+    INTEGER              :: i
+    
+    PRINT *,"---- GRID ----"
+    
+    IF (pt_grid%has_id) THEN
+      PRINT *,"id = ",TRIM(pt_grid%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    IF (pt_grid%has_name) THEN
+      PRINT *,"name = ",TRIM(pt_grid%name)
+    ELSE
+      PRINT *,"name undefined"
+    ENDIF
+    
+    IF (pt_grid%has_description) THEN
+      PRINT *,"description = ",TRIM(pt_grid%description)
+    ELSE
+      PRINT *,"description undefined"
+    ENDIF
+    
+    IF (pt_grid%has_dimension) THEN
+      PRINT *,"Global grid dimension :"
+      PRINT *,"   ni =",pt_grid%ni
+      PRINT *,"   nj =",pt_grid%nj
+    ELSE
+      PRINT *,"Global dimension ni, nj undefined"
+    ENDIF
+    
+    PRINT *,"grid domain :"
+    CALL domain__print(pt_grid%domain)
+    
+    PRINT *,"grid subdomain :",pt_grid%subdomain%size
+    
+    DO i=1,pt_grid%subdomain%size
+      CALL domain__print(pt_grid%subdomain%at(i)%pt)
+    ENDDO
+    
+    PRINT *,"--------------"
+    
+  END SUBROUTINE grid__print
+
+  SUBROUTINE grid__apply_default(pt_grid_default, pt_grid_in, pt_grid_out)
+
+    TYPE(grid), POINTER :: pt_grid_default, pt_grid_in, pt_grid_out
+
+    IF (pt_grid_in%has_name) THEN
+        pt_grid_out%name=pt_grid_in%name
+        pt_grid_out%has_name=.TRUE.
+    ELSE IF ( pt_grid_default%has_name) THEN
+        pt_grid_out%name=pt_grid_default%name
+        pt_grid_out%has_name=.TRUE.
+    ELSE
+        pt_grid_out%has_name=.FALSE.
+    ENDIF
+        
+    IF (pt_grid_in%has_description) THEN
+        pt_grid_out%description=pt_grid_in%description
+        pt_grid_out%has_description=.TRUE.
+    ELSE IF ( pt_grid_default%has_description ) THEN
+        pt_grid_out%description=pt_grid_default%description
+        pt_grid_out%has_description=.TRUE.
+    ELSE
+        pt_grid_out%has_description=.FALSE.
+    ENDIF
+  
+  END SUBROUTINE grid__apply_default
+
+END MODULE mod_grid
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_grid_definition.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_grid_definition.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_grid_definition.f90	(revision 8)
@@ -0,0 +1,17 @@
+MODULE mod_grid_definition
+  USE mod_grid_group
+  
+  TYPE(grid_group),SAVE,POINTER :: grid_definition
+  
+CONTAINS
+
+  SUBROUTINE grid_definition__Init
+  USE mod_grid_group
+  IMPLICIT NONE
+  
+    ALLOCATE(grid_definition)
+    CALL grid_group__new(grid_definition,"grid_definition")
+    
+  END SUBROUTINE grid_definition__Init
+        
+END MODULE mod_grid_definition
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_grid_group.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_grid_group.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_grid_group.f90	(revision 8)
@@ -0,0 +1,189 @@
+MODULE mod_grid_group
+  USE mod_grid
+  USE mod_xmlio_parameters
+
+  IMPLICIT NONE
+
+  TYPE grid_group
+    CHARACTER(LEN=str_len)                    :: id
+    LOGICAL                                   :: has_id
+    TYPE(vector_grid_group), POINTER          :: groups
+    TYPE(vector_grid),POINTER                 :: grids     
+    TYPE(grid), POINTER                       :: default_attribut
+  END TYPE grid_group
+
+  INCLUDE "vector_grid_group_def.inc"  
+
+  TYPE(vector_grid_group),POINTER       :: grid_group_Ids
+  TYPE(sorted_list),POINTER,PRIVATE     :: Ids 
+
+CONTAINS
+
+  INCLUDE "vector_grid_group_contains.inc"
+
+  SUBROUTINE grid_group__init
+  IMPLICIT NONE
+    
+    ALLOCATE(grid_group_Ids)
+    ALLOCATE(Ids)
+    
+    CALL vector_grid_group__new(grid_group_Ids)
+    CALL sorted_list__new(Ids)
+   
+  END SUBROUTINE grid_group__init
+
+  SUBROUTINE grid_group__get(Id,Pt_gg)
+  USE string_function
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN)     :: Id
+    TYPE(grid_group),POINTER        :: Pt_gg
+
+    INTEGER                         :: Pos
+    LOGICAL                         :: success
+    
+    CALL sorted_list__find(Ids,hash(Id),Pos,success)
+    IF (success) THEN
+      Pt_gg=>grid_group_ids%at(Pos)%Pt
+    ELSE
+      Pt_gg=>NULL()
+    ENDIF
+    
+  END SUBROUTINE grid_group__get
+    
+  RECURSIVE SUBROUTINE grid_group__new(Pt_gg,Id)
+  USE string_function
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER                :: Pt_gg
+    CHARACTER(LEN=*),OPTIONAL,INTENT(IN)     :: Id
+    
+    INTEGER :: Pos
+    
+    ALLOCATE(Pt_gg%groups)
+    ALLOCATE(Pt_gg%grids)
+    ALLOCATE(Pt_gg%default_attribut)
+    
+    CALL vector_grid_group__new(Pt_gg%groups)
+    CALL vector_grid__new(Pt_gg%grids)
+    CALL grid__new(Pt_gg%default_attribut)
+    Pt_gg%has_id=.FALSE.
+      
+    IF (PRESENT(Id)) THEN
+      Pt_gg%id=TRIM(Id)
+      Pt_gg%has_id=.TRUE.
+      CALL vector_grid_group__set_new(grid_group_Ids,Pt_gg,Pos)
+      CALL sorted_list__Add(Ids,hash(id),Pos)
+    ENDIF
+
+  END SUBROUTINE grid_group__new
+
+      
+  SUBROUTINE grid_group__get_new_group(Pt_gg,Pt_gg_out,Id)
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER             :: Pt_gg
+    TYPE(grid_group),POINTER             :: Pt_gg_out
+    CHARACTER(LEN=*),OPTIONAL            :: Id
+    
+    CALL vector_grid_group__get_new(Pt_gg%groups,Pt_gg_out)
+    CALL grid_group__new(Pt_gg_out)
+
+    IF (PRESENT(id)) THEN
+      CALL grid_group__new(Pt_gg_out,Id)
+    ELSE
+      CALL grid_group__new(Pt_gg_out)
+    ENDIF
+    
+  END SUBROUTINE grid_group__get_new_group
+
+  
+  SUBROUTINE grid_group__get_new_grid(Pt_gg,Pt_g_out,Id)
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER            :: Pt_gg
+    TYPE(grid),POINTER                  :: Pt_g_out
+    CHARACTER(LEN=*),OPTIONAL      :: Id
+    
+    CALL vector_grid__get_new(Pt_gg%grids,Pt_g_out)
+    
+    IF (PRESENT(id)) THEN
+      CALL grid__new(Pt_g_out,Id)
+    ELSE
+      CALL grid__new(Pt_g_out)
+    ENDIF
+    
+  END SUBROUTINE grid_group__get_new_grid
+  
+  
+  SUBROUTINE grid_group__get_default_attribut(Pt_gg,Pt_g)
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER  :: Pt_gg
+    TYPE(grid),POINTER        :: Pt_g
+    
+    Pt_g=>Pt_gg%default_attribut
+  END SUBROUTINE grid_group__get_default_attribut
+  
+  RECURSIVE SUBROUTINE grid_group__apply_default(Pt_gg,default)
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER      :: Pt_gg
+    TYPE(grid),POINTER,OPTIONAL   :: default
+    
+    INTEGER :: i
+    
+    IF (PRESENT(default)) THEN
+      CALL grid__apply_default(default,Pt_gg%default_attribut,Pt_gg%default_attribut)
+    ENDIF
+      
+    DO i=1,Pt_gg%groups%size
+      CALL grid_group__apply_default(Pt_gg%groups%at(i)%pt,Pt_gg%default_attribut)
+    ENDDO
+    
+    DO i=1,Pt_gg%grids%size
+      CALL grid__apply_default(Pt_gg%default_attribut,Pt_gg%grids%at(i)%pt,Pt_gg%grids%at(i)%pt)
+    ENDDO
+  
+  END SUBROUTINE grid_group__apply_default
+
+  RECURSIVE SUBROUTINE grid_group__Process_domain(Pt_gg)
+  IMPLICIT NONE
+  TYPE(grid_group),POINTER  :: Pt_gg
+    INTEGER :: i
+    
+    DO i=1,pt_gg%groups%size
+      CALL grid_group__process_domain(pt_gg%groups%at(i)%pt)
+    ENDDO
+    
+    DO i=1,pt_gg%grids%size
+      CALL grid__process_domain(pt_gg%grids%at(i)%pt)
+    ENDDO
+    
+  END SUBROUTINE grid_group__Process_domain
+      
+
+  RECURSIVE SUBROUTINE grid_group__print(Pt_gg)
+  IMPLICIT NONE
+    TYPE(grid_group),POINTER  :: Pt_gg
+   
+    INTEGER :: i
+    
+    PRINT *,"--- GRID GROUP ---"
+    IF (pt_gg%has_id) THEN
+      PRINT *,"id  ",TRIM(pt_gg%id)
+    ELSE
+      PRINT *,"id undefined"
+    ENDIF
+    
+    PRINT *,"grid default attribut :"
+    CALL grid__print(Pt_gg%default_attribut)    
+
+    PRINT *,"owned grid groups : ",Pt_gg%groups%size      
+    DO i=1,Pt_gg%groups%size
+      CALL grid_group__print(Pt_gg%groups%at(i)%pt)
+    ENDDO
+
+    PRINT *,"owned grid : ",Pt_gg%grids%size     
+    DO i=1,Pt_gg%grids%size
+      CALL grid__print(Pt_gg%grids%at(i)%pt)
+    ENDDO
+    PRINT *,"------------"
+  
+  END SUBROUTINE grid_group__print
+     
+END MODULE mod_grid_group
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_parse_xml.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_parse_xml.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_parse_xml.f90	(revision 8)
@@ -0,0 +1,673 @@
+MODULE parsing_xml
+  USE flib_dom
+  USE error_msg
+  USE string_function
+  
+CONTAINS
+
+  SUBROUTINE parsing_xml_file(name)
+  IMPLICIT NONE
+    CHARACTER(len=*), INTENT(IN) :: name
+    TYPE(fnode), POINTER :: myDoc
+
+    myDoc => parsefile(name)
+    CALL parsing_root(myDoc)
+
+    PRINT *, 'Le parsing est termine !!! '
+  
+  END SUBROUTINE parsing_xml_file
+  
+ 
+  SUBROUTINE parsing_root(root)
+  IMPLICIT NONE
+    TYPE(fnode), POINTER :: root
+    TYPE(fnode), POINTER :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+     
+     IF (hasChildNodes(root)) THEN
+      child_list => getChildnodes(root)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+          
+        SELECT CASE (TRIM(node_name)) 
+          
+           CASE ('simulation') 
+             CALL parsing_definition(child_node)
+
+           CASE DEFAULT
+             IF (is_bad_node(node_name)) THEN
+               WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing root'
+               CALL Warning("mod_parse_xml:parsing_root")
+             ENDIF
+         END SELECT
+       
+       ENDDO
+    ENDIF
+             
+  END SUBROUTINE parsing_root
+
+
+  SUBROUTINE parsing_definition(root)
+  USE mod_axis_definition
+  USE mod_grid_definition
+  USE mod_field_definition
+  USE mod_file_definition
+  
+  IMPLICIT NONE
+    TYPE(fnode), POINTER :: root
+    TYPE(fnode), POINTER :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+
+    IF (hasChildNodes(root)) THEN
+      child_list => getChildnodes(root)
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+          
+        SELECT CASE (TRIM(node_name)) 
+          
+           CASE ('axis_definition') 
+             CALL parsing_axis_group(child_node,axis_definition,root=.TRUE.)
+               
+           CASE ('grid_definition')
+             CALL parsing_grid_group(child_node,grid_definition,root=.TRUE.)
+               
+           CASE ('field_definition')
+             CALL parsing_field_group(child_node,field_definition,root=.TRUE.)
+               
+           CASE ('file_definition')
+             CALL parsing_file_group(child_node,file_definition,root=.TRUE.)
+               
+           CASE DEFAULT
+             IF (is_bad_node(node_name)) THEN
+               WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing definition'
+               CALL Warning("mod_parse_xml:parsing_definition")
+             ENDIF   
+         END SELECT
+       
+       ENDDO
+    ENDIF
+    
+  END SUBROUTINE parsing_definition
+ 
+
+
+
+
+  
+  RECURSIVE SUBROUTINE parsing_axis_group(node,parent,root)
+  USE mod_axis_definition
+  USE mod_axis_group
+  USE mod_axis
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER         :: node
+    TYPE(axis_group),POINTER     :: parent
+    LOGICAL,INTENT(IN),OPTIONAL :: root
+    
+    TYPE(axis_group),POINTER :: pt_axis_group
+    TYPE(fnode), POINTER     :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+    TYPE(axis),POINTER       :: attribute
+    LOGICAL                  :: is_root
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+    
+    is_root=.FALSE.
+    IF (PRESENT(root)) is_root=root
+  
+    IF (is_root) THEN
+      pt_axis_group=>parent
+    ELSE  
+      IF (is_attribute_exist(node,"id")) THEN
+        value=getAttribute(node,"id")
+        CALL axis_group__get_new_group(parent,pt_axis_group,TRIM(value))
+      ELSE
+        CALL axis_group__get_new_group(parent,pt_axis_group)
+      ENDIF
+    ENDIF
+      
+    CALL axis_group__get_default_attribut(pt_axis_group,attribute)
+    CALL parsing_axis_attribute(node,attribute)
+    
+    IF (hasChildNodes(node)) THEN
+      child_list => getChildnodes(node)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+        
+        SELECT CASE (TRIM(node_name)) 
+        
+          CASE ('group') 
+            CALL parsing_axis_group(child_node,pt_axis_group)
+             
+          CASE ('axis')
+            CALL parsing_axis(child_node,pt_axis_group)
+
+          CASE DEFAULT
+            IF (is_bad_node(node_name)) THEN
+              WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing group_axis'
+              CALL Warning("mod_parse_xml:parsing_group_axis")
+            ENDIF
+        END SELECT
+      ENDDO
+    ENDIF
+
+  END SUBROUTINE parsing_axis_group
+
+  SUBROUTINE parsing_axis(node,parent)
+  USE mod_axis_group
+  USE mod_axis
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER     :: node
+    TYPE(axis_group),POINTER :: parent
+    
+    TYPE(axis),POINTER :: pt_axis
+    TYPE(axis),POINTER       :: attribute
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+  
+      
+    IF (is_attribute_exist(node,"id")) THEN
+      value=getAttribute(node,"id")
+      CALL axis_group__get_new_axis(parent,pt_axis,TRIM(value))
+    ELSE
+      CALL axis_group__get_new_axis(parent,pt_axis)
+    ENDIF
+      
+    CALL parsing_axis_attribute(node,pt_axis)
+  
+  END SUBROUTINE parsing_axis
+
+  
+  SUBROUTINE parsing_axis_attribute(node,pt_axis)
+  USE mod_axis
+  IMPLICIT NONE
+    TYPE(fnode), POINTER     :: node
+    TYPE(axis),POINTER :: pt_axis
+
+    CHARACTER(len=100) :: value
+   
+    IF (is_attribute_exist(node,"name")) THEN
+      value =  getAttribute(node,"name")
+      CALL axis__set(pt_axis,name=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"description")) THEN
+      value =  getAttribute(node,"description")
+      CALL axis__set(pt_axis,description=TRIM(value))
+    ENDIF
+        
+    IF (is_attribute_exist(node,"unit")) THEN
+      value =  getAttribute(node,"unit")
+      CALL axis__set(pt_axis,unit=TRIM(value))
+    ENDIF
+   
+  END SUBROUTINE parsing_axis_attribute 
+
+
+
+
+
+
+
+
+  RECURSIVE SUBROUTINE parsing_grid_group(node,parent,root)
+  USE mod_grid_definition
+  USE mod_grid_group
+  USE mod_grid
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER     :: node
+    TYPE(grid_group),POINTER :: parent
+    LOGICAL,INTENT(IN),OPTIONAL :: root
+
+    TYPE(grid_group),POINTER :: pt_grid_group
+    TYPE(fnode), POINTER     :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+    TYPE(grid),POINTER       :: attribute
+    LOGICAL                  :: is_root
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+  
+    is_root=.FALSE.
+    IF (PRESENT(root)) is_root=root
+  
+    IF (is_root) THEN
+      pt_grid_group=>parent
+    ELSE  
+      IF (is_attribute_exist(node,"id")) THEN
+        value=getAttribute(node,"id")
+        CALL grid_group__get_new_group(parent,pt_grid_group,TRIM(value))
+      ELSE
+        CALL grid_group__get_new_group(parent,pt_grid_group)
+      ENDIF
+    ENDIF
+      
+    CALL grid_group__get_default_attribut(pt_grid_group,attribute)
+    CALL parsing_grid_attribute(node,attribute)
+    
+    IF (hasChildNodes(node)) THEN
+      child_list => getChildnodes(node)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+        
+        SELECT CASE (TRIM(node_name)) 
+        
+          CASE ('group') 
+            CALL parsing_grid_group(child_node,pt_grid_group)
+             
+          CASE ('grid')
+            CALL parsing_grid(child_node,pt_grid_group)
+
+          CASE DEFAULT
+            IF (is_bad_node(node_name)) THEN
+              WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing group_grid'
+              CALL Warning("mod_parse_xml:parsing_group_grid")
+            ENDIF
+        END SELECT
+      ENDDO
+    ENDIF
+
+  END SUBROUTINE parsing_grid_group
+
+  SUBROUTINE parsing_grid(node,parent)
+  USE mod_grid_group
+  USE mod_grid
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER     :: node
+    TYPE(grid_group),POINTER :: parent
+    
+    TYPE(grid),POINTER :: pt_grid
+    TYPE(grid),POINTER       :: attribute
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+  
+      
+    IF (is_attribute_exist(node,"id")) THEN
+      value=getAttribute(node,"id")
+      CALL grid_group__get_new_grid(parent,pt_grid,TRIM(value))
+    ELSE
+      CALL grid_group__get_new_grid(parent,pt_grid)
+    ENDIF
+      
+    CALL parsing_grid_attribute(node,pt_grid)
+  
+  END SUBROUTINE parsing_grid
+
+  
+  SUBROUTINE parsing_grid_attribute(node,pt_grid)
+  USE mod_grid
+  IMPLICIT NONE
+    TYPE(fnode), POINTER     :: node
+    TYPE(grid),POINTER :: pt_grid
+
+    CHARACTER(len=100) :: value
+   
+    IF (is_attribute_exist(node,"name")) THEN
+      value =  getAttribute(node,"name")
+      CALL grid__set(pt_grid,name=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"description")) THEN
+      value =  getAttribute(node,"description")
+      CALL grid__set(pt_grid,description=TRIM(value))
+    ENDIF
+        
+  END SUBROUTINE parsing_grid_attribute 
+
+
+
+
+
+
+
+  RECURSIVE SUBROUTINE parsing_field_group(node,parent,root)
+  USE mod_field_definition
+  USE mod_field_group
+  USE mod_field
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER          :: node
+    TYPE(field_group),POINTER     :: parent
+    LOGICAL,INTENT(IN),OPTIONAL   :: root
+    
+    TYPE(field_group),POINTER :: pt_field_group
+    TYPE(fnode), POINTER     :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+    TYPE(field),POINTER       :: attribute
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+    LOGICAL            :: is_root
+    
+    is_root=.FALSE.
+    IF (PRESENT(root)) is_root=root
+    
+    IF (is_root) THEN
+      pt_field_group=>parent
+    ELSE  
+      IF (is_attribute_exist(node,"id")) THEN
+        value=getAttribute(node,"id")
+        CALL field_group__get_new_group(parent,pt_field_group,TRIM(value))
+      ELSE
+        CALL field_group__get_new_group(parent,pt_field_group)
+      ENDIF
+    ENDIF
+      
+    CALL field_group__get_default_attribut(pt_field_group,attribute)
+    CALL parsing_field_attribute(node,attribute)
+    
+    IF (hasChildNodes(node)) THEN
+      child_list => getChildnodes(node)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+        
+        SELECT CASE (TRIM(node_name)) 
+        
+          CASE ('group') 
+            CALL parsing_field_group(child_node,pt_field_group)
+             
+          CASE ('field')
+            CALL parsing_field(child_node,pt_field_group)
+
+          CASE DEFAULT
+            IF (is_bad_node(node_name)) THEN
+              WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing group_field'
+              CALL Warning("mod_parse_xml:parsing_group_field")
+            ENDIF
+        END SELECT
+      ENDDO
+    ENDIF
+
+  END SUBROUTINE parsing_field_group
+
+  SUBROUTINE parsing_field(node,parent)
+  USE mod_field_group
+  USE mod_field
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER     :: node
+    TYPE(field_group),POINTER :: parent
+    
+    TYPE(field),POINTER :: pt_field
+    TYPE(field),POINTER       :: attribute
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+  
+      
+    IF (is_attribute_exist(node,"id")) THEN
+      value=getAttribute(node,"id")
+      CALL field_group__get_new_field(parent,pt_field,TRIM(value))
+    ELSE
+      CALL field_group__get_new_field(parent,pt_field)
+    ENDIF
+      
+    CALL parsing_field_attribute(node,pt_field)
+  
+  END SUBROUTINE parsing_field
+
+  
+  SUBROUTINE parsing_field_attribute(node,pt_field)
+  USE mod_field
+  IMPLICIT NONE
+    TYPE(fnode), POINTER     :: node
+    TYPE(field),POINTER :: pt_field
+
+    CHARACTER(len=100) :: value
+   
+    IF (is_attribute_exist(node,"name")) THEN
+      value =  getAttribute(node,"name")
+      CALL field__set(pt_field,name=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"description")) THEN
+      value =  getAttribute(node,"description")
+      CALL field__set(pt_field,description=TRIM(value))
+    ENDIF
+        
+    IF (is_attribute_exist(node,"unit")) THEN
+      value =  getAttribute(node,"unit")
+      CALL field__set(pt_field,unit=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"operation")) THEN
+      value =  getAttribute(node,"operation")
+      CALL field__set(pt_field,operation=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"freq_op")) THEN
+      value =  getAttribute(node,"freq_op")
+      CALL field__set(pt_field,freq_op=string_to_integer(value))
+    ENDIF
+   
+    IF (is_attribute_exist(node,"axis_ref")) THEN
+      value =  getAttribute(node,"axis_ref")
+      CALL field__set(pt_field,axis_ref=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"grid_ref")) THEN
+      value =  getAttribute(node,"grid_ref")
+      CALL field__set(pt_field,grid_ref=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"level")) THEN
+      value =  getAttribute(node,"level")
+      CALL field__set(pt_field,level=string_to_integer(value))
+    ENDIF
+    
+    IF (is_attribute_exist(node,"prec")) THEN
+      value =  getAttribute(node,"prec")
+      CALL field__set(pt_field,prec=string_to_integer(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"ref")) THEN
+      value =  getAttribute(node,"ref")
+      CALL field__set(pt_field,ref=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"enabled")) THEN
+      value =  getAttribute(node,"enabled")
+      CALL field__set(pt_field,enabled=string_to_logical(value))
+    ENDIF
+  
+
+  END SUBROUTINE parsing_field_attribute 
+  
+  
+  
+
+
+  RECURSIVE SUBROUTINE parsing_file_group(node,parent,root)
+  USE mod_file_definition
+  USE mod_file_group
+  USE mod_file
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER          :: node
+    TYPE(file_group),POINTER      :: parent
+    LOGICAL,INTENT(IN),OPTIONAL   :: root
+
+    TYPE(file_group),POINTER :: pt_file_group
+    TYPE(fnode), POINTER     :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+    TYPE(file),POINTER       :: attribute
+    LOGICAL                  :: is_root
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+    
+    is_root=.FALSE.
+    IF (PRESENT(root)) is_root=root
+  
+    IF (is_root) THEN
+      pt_file_group=>parent
+    ELSE  
+      IF (is_attribute_exist(node,"id")) THEN
+        value=getAttribute(node,"id")
+        CALL file_group__get_new_group(parent,pt_file_group,TRIM(value))
+      ELSE
+        CALL file_group__get_new_group(parent,pt_file_group)
+      ENDIF
+    ENDIF
+      
+    CALL file_group__get_default_attribut(pt_file_group,attribute)
+    CALL parsing_file_attribute(node,attribute)
+    
+    IF (hasChildNodes(node)) THEN
+      child_list => getChildnodes(node)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+        
+        SELECT CASE (TRIM(node_name)) 
+        
+          CASE ('group') 
+            CALL parsing_file_group(child_node,pt_file_group)
+             
+          CASE ('file')
+            CALL parsing_file(child_node,pt_file_group)
+
+          CASE DEFAULT
+            IF (is_bad_node(node_name)) THEN
+              WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing group_file'
+              CALL Warning("mod_parse_xml:parsing_group_file")
+            ENDIF
+        END SELECT
+      ENDDO
+    ENDIF
+
+  END SUBROUTINE parsing_file_group
+
+  SUBROUTINE parsing_file(node,parent)
+  USE mod_file_group
+  USE mod_file
+  IMPLICIT NONE  
+    TYPE(fnode), POINTER     :: node
+    TYPE(file_group),POINTER :: parent
+    
+    TYPE(file),POINTER :: pt_file
+    TYPE(file),POINTER       :: attribute
+    TYPE(fnode), POINTER     :: child_node
+    TYPE(fnodeList), POINTER :: child_list
+    INTEGER :: il
+    CHARACTER(len=100) :: node_name
+    CHARACTER(len=100) :: value
+  
+      
+    IF (is_attribute_exist(node,"id")) THEN
+      value=getAttribute(node,"id")
+      CALL file_group__get_new_file(parent,pt_file,TRIM(value))
+    ELSE
+      CALL file_group__get_new_file(parent,pt_file)
+    ENDIF
+      
+    CALL parsing_file_attribute(node,pt_file)
+  
+    IF (hasChildNodes(node)) THEN
+      child_list => getChildnodes(node)
+
+      DO il=0,getLength(child_list)-1
+        child_node => item(child_list,il)
+        node_name=getNodename(child_node)
+        
+        SELECT CASE (TRIM(node_name)) 
+        
+          CASE ('group') 
+            CALL parsing_field_group(child_node,pt_file%field_list)
+             
+          CASE ('field')
+            CALL parsing_field(child_node,pt_file%field_list)
+
+          CASE DEFAULT
+            IF (is_bad_node(node_name)) THEN
+              WRITE(message,*) 'Unknown node <<',TRIM(node_name),'>> while parsing group_file'
+              CALL Warning("mod_parse_xml:parsing_group_file")
+            ENDIF
+        END SELECT
+      ENDDO
+    ENDIF
+  END SUBROUTINE parsing_file
+
+  
+  SUBROUTINE parsing_file_attribute(node,pt_file)
+  USE mod_file
+  IMPLICIT NONE
+    TYPE(fnode), POINTER     :: node
+    TYPE(file),POINTER :: pt_file
+
+    CHARACTER(len=100) :: value
+   
+    IF (is_attribute_exist(node,"name")) THEN
+      value =  getAttribute(node,"name")
+      CALL file__set(pt_file,name=TRIM(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"description")) THEN
+      value =  getAttribute(node,"description")
+      CALL file__set(pt_file,description=TRIM(value))
+    ENDIF
+        
+    IF (is_attribute_exist(node,"output_freq")) THEN
+      value =  getAttribute(node,"output_freq")
+      CALL file__set(pt_file,output_freq=string_to_integer(value))
+    ENDIF
+   
+    IF (is_attribute_exist(node,"output_level")) THEN
+      value =  getAttribute(node,"output_level")
+      CALL file__set(pt_file,output_level=string_to_integer(value))
+    ENDIF
+
+    IF (is_attribute_exist(node,"enabled")) THEN
+      value =  getAttribute(node,"enabled")
+      CALL file__set(pt_file,enabled=string_to_logical(value))
+    ENDIF
+
+  END SUBROUTINE parsing_file_attribute
+  
+
+   
+  
+  FUNCTION is_attribute_exist(node, name)
+
+    LOGICAL :: is_attribute_exist
+    TYPE(fnode), POINTER :: node
+    CHARACTER(len=*) :: name
+    CHARACTER(len=100) :: value
+
+    value=""
+    
+    is_attribute_exist= .false.
+    value=getAttribute(node, TRIM(name))
+    IF (value .NE. "") is_attribute_exist= .true.
+
+  END FUNCTION is_attribute_exist
+
+  FUNCTION is_bad_node(node_name)
+  IMPLICIT NONE
+    CHARACTER(len=*),INTENT(IN) :: node_name
+    LOGICAL                     :: is_bad_node
+    
+    IF (TRIM(node_name)=='#text' .OR. TRIM(node_name)=='#comment') THEN
+      is_bad_node=.FALSE.
+    ELSE
+      is_bad_node=.TRUE.
+    ENDIF
+      
+  END FUNCTION is_bad_node
+  
+END MODULE parsing_xml
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_sorted_list.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_sorted_list.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_sorted_list.f90	(revision 8)
@@ -0,0 +1,167 @@
+MODULE mod_sorted_list
+
+  PRIVATE
+  
+  TYPE node
+   INTEGER :: key
+   INTEGER :: value
+   LOGICAL :: has_value
+   TYPE(node),POINTER :: child1
+   TYPE(node),POINTER :: child2
+  END TYPE node
+
+TYPE, PUBLIC :: sorted_list
+  PRIVATE
+  TYPE(vector_node),POINTER :: tree => NULL()
+  TYPE(node),POINTER        :: first => NULL()
+  INTEGER :: size = 0
+  LOGICAL :: is_init=.FALSE.
+END TYPE sorted_list 
+
+  PUBLIC :: sorted_list__new, sorted_list__add, sorted_list__find, sorted_list__delete 
+INCLUDE 'vector_node_def.inc'
+
+CONTAINS
+
+INCLUDE 'vector_node_contains.inc'
+  
+  SUBROUTINE node__new(Pt_n)
+  IMPLICIT NONE
+    TYPE(node), POINTER :: Pt_n
+    
+    Pt_n%has_value=.FALSE.
+    Pt_n%child1=>NULL()
+    pt_n%child2=>NULL()
+  END SUBROUTINE node__new
+  
+  
+  SUBROUTINE sorted_list__new(Pt_sl)
+  IMPLICIT NONE
+    TYPE(sorted_list), POINTER :: Pt_sl
+    TYPE(node), POINTER :: Pt_n
+    
+    IF (Pt_sl%is_init) CALL sorted_list__delete(Pt_sl)
+    
+    ALLOCATE(Pt_sl%tree)
+    CALL vector_node__new(Pt_sl%tree)
+    CALL vector_node__get_new(Pt_sl%tree,Pt_n)
+    CALL node__new(Pt_n)  
+    Pt_sl%first=>Pt_n
+    Pt_sl%Size=0
+    Pt_sl%is_init=.TRUE.
+    
+  END SUBROUTINE  sorted_list__new
+  
+  SUBROUTINE sorted_list__delete(Pt_sl)
+  IMPLICIT NONE
+    TYPE(sorted_list), POINTER :: Pt_sl
+    TYPE(node), POINTER :: Pt_n
+
+    IF (Pt_sl%is_init) THEN
+      CALL vector_node__delete(Pt_sl%tree)
+      DEALLOCATE(Pt_sl%tree)
+      Pt_sl%is_init=.FALSE.
+    ENDIF
+   
+  END SUBROUTINE  sorted_list__delete
+
+   
+  SUBROUTINE sorted_list__Add(Pt_sl,key,value)
+  IMPLICIT NONE
+    TYPE(sorted_list), POINTER :: Pt_sl
+    INTEGER,INTENT(IN)  :: key
+    INTEGER,INTENT(IN)  :: value
+
+    LOGICAL               :: Out
+    TYPE(node), POINTER   :: current
+    TYPE(node), POINTER   :: new 
+    
+    
+    CALL vector_node__get_new(Pt_sl%tree,new)
+    CALL node__new(new)
+    current=>Pt_sl%first
+    
+      
+    Out=.FALSE.
+    
+    DO WHILE (.NOT. out)
+      IF (current%has_value) THEN
+        IF (key > current%key) THEN
+          IF (ASSOCIATED(current%child2)) THEN
+            current=>current%child2
+          ELSE
+            current%child2=>new
+            out=.FALSE.
+          ENDIF
+        ELSE
+          IF (ASSOCIATED(current%child1)) THEN
+            current=>current%child1
+          ELSE
+            current%child1=>new
+            out=.FALSE.
+          ENDIF
+        ENDIF 
+      ELSE
+        current%has_value=.TRUE.
+        current%key=key
+        current%value=value
+        out=.TRUE.
+      ENDIF
+    ENDDO
+    
+    Pt_sl%Size=Pt_sl%Size+1
+       
+  END SUBROUTINE sorted_list__Add
+
+  
+  SUBROUTINE sorted_list__find(Pt_sl,key,value,success)
+  IMPLICIT NONE
+    TYPE(sorted_list),POINTER   :: Pt_sl
+    INTEGER,INTENT(IN)          :: key
+    INTEGER,INTENT(OUT)         :: value
+    LOGICAL,INTENT(OUT)         :: success
+    
+    LOGICAL               :: Out
+    TYPE(node), POINTER   :: current
+    
+    current=>Pt_sl%first
+    Out=.FALSE.
+    Success=.FALSE.
+    
+    DO WHILE (.NOT. out)
+      IF (current%has_value) THEN
+        IF (key == current%key) THEN
+          value=current%value
+          success=.TRUE.
+          out=.TRUE.
+        ELSE IF (key > current%key) THEN
+          IF (ASSOCIATED(current%child2)) THEN
+            current=>current%child2
+          ELSE
+            out=.TRUE.
+          ENDIF
+        ELSE
+          IF (ASSOCIATED(current%child1)) THEN
+            current=>current%child1
+          ELSE
+            out=.TRUE.
+          ENDIF
+        ENDIF
+      ELSE
+        out=.TRUE. 
+      ENDIF
+    ENDDO
+
+  END SUBROUTINE sorted_list__find
+
+  
+  SUBROUTINE sorted_list__get_first(Pt_sl,Pt_n)
+  IMPLICIT NONE
+    TYPE(sorted_list),POINTER   :: Pt_sl
+    TYPE(node),POINTER          :: Pt_n
+
+    Pt_n=>Pt_sl%tree%at(1)%Pt
+  END SUBROUTINE sorted_list__get_first  
+
+
+END MODULE mod_sorted_list
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_vector_field.F90.old
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_vector_field.F90.old	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_vector_field.F90.old	(revision 8)
@@ -0,0 +1,43 @@
+MODULE mod_field_vector
+  USE mod_field
+  
+  PRIVATE
+  
+   TYPE,PUBLIC :: field_vector
+     PRIVATE
+     TYPE(vector), POINTER :: list
+     TYPE(field),  POINTER :: default_attribut
+   END TYPE field_vector
+
+#define DATA_TYPE field
+#include "vectors_def.inc"
+
+  PUBLIC field_vector__new, field_vector__get_new
+
+CONTAINS
+
+#include "vectors_contains.inc"
+    
+  SUBROUTINE field_vector__new(Pt_vf)
+  IMPLICIT NONE
+    TYPE(field_vector),POINTER  :: Pt_vf
+    
+      CALL vector__new(Pt_vf%list)
+      CALL field__new(Pt_vf%default_attribut)
+  
+  END SUBROUTINE field_vector__new
+  
+
+  SUBROUTINE field_vector__get_new(Pt_vf,Pt_f_out,Id)
+  IMPLICIT NONE  
+    TYPE(field_vector),POINTER           :: Pt_vf
+    TYPE(field),POINTER                  :: Pt_f_out
+    CHARACTER(LEN=str_len),OPTIONAL      :: Id
+      
+      CALL vector__get_new(Pt_vf%list,Pt_f_out)
+      CALL field__new(Pt_f_out)
+   END SUBROUTINE field_vector__get_new
+   
+   
+END MODULE mod_field_vector
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/mod_xmlio_parameters.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/mod_xmlio_parameters.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/mod_xmlio_parameters.f90	(revision 8)
@@ -0,0 +1,14 @@
+MODULE mod_xmlio_parameters
+
+  INTEGER, PARAMETER :: str_len=100
+  INTEGER, PARAMETER :: array_size_unit=2
+  INTEGER, PARAMETER :: default_vector_size=100
+  REAL, PARAMETER    :: default_vector_grow_factor=1.5
+  INTEGER, PARAMETER :: str_msg_len=1024
+  
+  INTEGER,PARAMETER  :: internal_file=10
+  INTEGER,PARAMETER  :: internal_field=10
+  INTEGER,PARAMETER  :: internal_axis=10
+  INTEGER,PARAMETER  :: internal_grid=10
+  
+END MODULE mod_xmlio_parameters
Index: XMLIO_SERVER/trunk/src/XMLIO/string_function.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/string_function.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/string_function.f90	(revision 8)
@@ -0,0 +1,97 @@
+MODULE string_function
+ 
+
+
+
+CONTAINS
+
+  FUNCTION Hash(Str)
+  IMPLICIT NONE  
+    CHARACTER(LEN=*),INTENT(IN) :: Str
+    CHARACTER(LEN=LEN(str)) :: new_str
+    INTEGER :: Hash
+    INTEGER :: c
+    INTEGER :: i
+    
+    new_str=ADJUSTL(ADJUSTR(Str))
+    
+    Hash=0
+    DO i=1,LEN_TRIM(new_Str)
+      c = IACHAR(new_Str(i:i))
+      Hash=c+ISHFT(Hash,6)+ISHFT(Hash,16)-Hash
+    ENDDO
+    
+  END FUNCTION Hash
+  
+  FUNCTION String_to_integer(str,succed)
+  USE error_msg
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: Str
+    LOGICAL,OPTIONAL            :: succed
+    
+    INTEGER :: String_to_integer
+    INTEGER :: ierr
+    
+    READ(Str,FMT=*,iostat=ierr) String_to_integer
+    
+    IF (PRESENT(succed)) succed=.TRUE.
+      
+    IF (ierr/=0) THEN
+      IF (PRESENT(succed)) THEN
+        succed=.FALSE.
+      ELSE 
+        WRITE (message,*) 'Error when attempting to convert string :<<',TRIM(str),'>> to integer'
+        CALL Error("string_function:string_to_integer")
+      ENDIF
+    ENDIF
+  END FUNCTION String_to_integer
+  
+  FUNCTION String_to_real(str,succed)
+  USE error_msg
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: Str
+    LOGICAL,OPTIONAL            :: succed
+    
+    REAL    :: String_to_real
+    INTEGER :: ierr
+    
+    READ(Str,FMT=*,iostat=ierr) String_to_real
+    
+    IF (PRESENT(succed)) succed=.TRUE.
+      
+    IF (ierr/=0) THEN
+      IF (PRESENT(succed)) THEN
+        succed=.FALSE.
+      ELSE 
+        WRITE (message,*) 'Error when attempting to convert string :<<',TRIM(str),'>> to real'
+        CALL Error("string_function:string_to_real")
+      ENDIF
+    ENDIF
+    
+  END FUNCTION String_to_real
+  
+  FUNCTION String_to_logical(str,succed)
+  USE error_msg
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: Str
+    LOGICAL,OPTIONAL            :: succed
+    
+    LOGICAL :: String_to_logical
+    INTEGER :: ierr
+    
+    READ(Str,FMT=*,iostat=ierr) String_to_logical
+    
+    IF (PRESENT(succed)) succed=.TRUE.
+      
+    IF (ierr/=0) THEN
+      IF (PRESENT(succed)) THEN
+        succed=.FALSE.
+      ELSE 
+        WRITE (message,*) 'Error when attempting to convert string :<<',TRIM(str),'>> to logical'
+        CALL Error("string_function:string_to_logical")
+      ENDIF
+    ENDIF
+    
+  END FUNCTION String_to_logical
+    
+END MODULE string_function
Index: XMLIO_SERVER/trunk/src/XMLIO/test_xmlio.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/test_xmlio.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/test_xmlio.f90	(revision 8)
@@ -0,0 +1,85 @@
+PROGRAM test_xmlio
+  USE xmlio
+  USE mod_interface_ioipsl
+  IMPLICIT NONE
+  
+  TYPE(field),POINTER :: Pt_f
+  TYPE(field_group),POINTER :: Pt_fg
+  TYPE(file),POINTER :: Pt_file
+  TYPE(grid),POINTER :: pt_grid 
+  INTEGER,PARAMETER  :: ni=360
+  INTEGER,PARAMETER  :: nj=180
+  REAL,DIMENSION(ni,nj) :: lon
+  REAL,DIMENSION(ni,nj) :: lat
+  INTEGER               :: i,j
+  TYPE(axis),POINTER :: pt_axis 
+  
+  DO i=1,ni
+    DO j=1,nj
+      lon(i,j)=i
+      lat(i,j)=j
+    ENDDO
+  ENDDO  
+  
+  
+  
+  CALL xmlio__init("iodef.xml")
+
+  CALL grid__get("grid_T",pt_grid)
+  CALL domain__set(pt_grid%domain,0,ni,nj,1,1,lon,lat)
+
+  CALL grid__get("grid_U",pt_grid)
+  CALL domain__set(pt_grid%domain,0,ni,nj,1,1,lon,lat)
+
+  CALL grid__get("grid_V",pt_grid)
+  CALL domain__set(pt_grid%domain,0,ni,nj,1,1,lon,lat)
+
+  CALL grid__get("grid_W",pt_grid)
+  CALL domain__set(pt_grid%domain,0,ni,nj,1,1,lon,lat)
+  
+  CALL axis__get("deptht",pt_axis)
+  CALL axis__set(pt_axis,a_size=5,values=(/1.,2.,3.,4.,5./))
+
+  CALL axis__get("depthu",pt_axis)
+  CALL axis__set(pt_axis,a_size=5,values=(/1.,2.,3.,4.,5./))
+
+  CALL axis__get("depthv",pt_axis)
+  CALL axis__set(pt_axis,a_size=5,values=(/1.,2.,3.,4.,5./))
+
+  CALL axis__get("depthw",pt_axis)
+  CALL axis__set(pt_axis,a_size=5,values=(/1.,2.,3.,4.,5./))
+
+
+  CALL axis_group__apply_default(axis_definition)
+  CALL grid_group__apply_default(grid_definition)
+  CALL field_group__apply_default(field_definition)
+  CALL file_group__apply_default(file_definition)
+  
+  CALL field_group__solve_ref(field_definition)
+  CALL file_group__solve_field_ref(file_definition)
+
+  CALL file_group__check(file_definition)
+  CALL axis_group__check(axis_definition)
+
+!
+  CALL axis_group__print(axis_definition)
+  CALL grid_group__print(grid_definition)
+  CALL field_group__print(field_definition)
+  CALL file_group__print(file_definition)
+!  CALL field_group__get_new_field(field_definition,pt_f,"toto")
+!  CALL field__set(Pt_f,name="toto",unit="kg")
+!  CALL field_group__get_new_field(field_definition,pt_f,"tata")
+!  CALL field__set(Pt_f,name="tata",unit="kg")
+!  CALL field_group__get_new_field(field_definition,pt_f,"titi")
+!  CALL field__set(Pt_f,name="titi",unit="kg")
+!  CALL field_group__get_new_field(field_definition,pt_f,"xyz")
+!  CALL field__set(Pt_f,name="xyz",unit="kg")
+   CALL set_file_dependency
+   CALL set_field_enabled
+   CALL set_field_dependency
+   
+   CALL set_time_parameters(0,0.,3600.)
+   
+   CALL create_header
+   
+END PROGRAM test_xmlio
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_axis_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_axis_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_axis_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_axis__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_axis), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_axis__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_axis__new
+  
+  SUBROUTINE vector_axis__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_axis), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL axis__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_axis__delete
+  
+  SUBROUTINE vector_axis__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_axis), INTENT(INOUT)   :: vect
+    TYPE(axis),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_axis__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_axis__get_new
+
+  SUBROUTINE vector_axis__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_axis), INTENT(INOUT)   :: vect
+    TYPE(axis),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_axis__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_axis__set_new
+  
+  SUBROUTINE vector_axis__increase(vect)
+    TYPE(vector_axis), INTENT(INOUT) :: vect
+    TYPE (Pt_axis), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_axis__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_axis_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_axis_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_axis_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_axis 
+    TYPE (axis),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_axis
+
+  TYPE vector_axis
+  
+    TYPE (Pt_axis), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_axis
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_axis_group__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_axis_group), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_axis_group__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_axis_group__new
+  
+  SUBROUTINE vector_axis_group__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_axis_group), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL axis_group__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_axis_group__delete
+  
+  SUBROUTINE vector_axis_group__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_axis_group), INTENT(INOUT)   :: vect
+    TYPE(axis_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_axis_group__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_axis_group__get_new
+
+  SUBROUTINE vector_axis_group__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_axis_group), INTENT(INOUT)   :: vect
+    TYPE(axis_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_axis_group__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_axis_group__set_new
+  
+  SUBROUTINE vector_axis_group__increase(vect)
+    TYPE(vector_axis_group), INTENT(INOUT) :: vect
+    TYPE (Pt_axis_group), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_axis_group__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_axis_group_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_axis_group 
+    TYPE (axis_group),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_axis_group
+
+  TYPE vector_axis_group
+  
+    TYPE (Pt_axis_group), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_axis_group
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_contains.template
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_contains.template	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_contains.template	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_#TYPE#__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_#TYPE#), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_#TYPE#__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_#TYPE#__new
+  
+  SUBROUTINE vector_#TYPE#__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_#TYPE#), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL #TYPE#__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_#TYPE#__delete
+  
+  SUBROUTINE vector_#TYPE#__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_#TYPE#), INTENT(INOUT)   :: vect
+    TYPE(#TYPE#),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_#TYPE#__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_#TYPE#__get_new
+
+  SUBROUTINE vector_#TYPE#__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_#TYPE#), INTENT(INOUT)   :: vect
+    TYPE(#TYPE#),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_#TYPE#__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_#TYPE#__set_new
+  
+  SUBROUTINE vector_#TYPE#__increase(vect)
+    TYPE(vector_#TYPE#), INTENT(INOUT) :: vect
+    TYPE (Pt_#TYPE#), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_#TYPE#__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_def.template
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_def.template	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_def.template	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_#TYPE# 
+    TYPE (#TYPE#),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_#TYPE#
+
+  TYPE vector_#TYPE#
+  
+    TYPE (Pt_#TYPE#), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_#TYPE#
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_domain_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_domain_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_domain_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_domain__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_domain), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_domain__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_domain__new
+  
+  SUBROUTINE vector_domain__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_domain), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL domain__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_domain__delete
+  
+  SUBROUTINE vector_domain__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_domain), INTENT(INOUT)   :: vect
+    TYPE(domain),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_domain__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_domain__get_new
+
+  SUBROUTINE vector_domain__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_domain), INTENT(INOUT)   :: vect
+    TYPE(domain),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_domain__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_domain__set_new
+  
+  SUBROUTINE vector_domain__increase(vect)
+    TYPE(vector_domain), INTENT(INOUT) :: vect
+    TYPE (Pt_domain), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_domain__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_domain_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_domain_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_domain_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_domain 
+    TYPE (domain),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_domain
+
+  TYPE vector_domain
+  
+    TYPE (Pt_domain), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_domain
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_field__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_field), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_field__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_field__new
+  
+  SUBROUTINE vector_field__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_field), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL field__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_field__delete
+  
+  SUBROUTINE vector_field__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field), INTENT(INOUT)   :: vect
+    TYPE(field),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field__get_new
+
+  SUBROUTINE vector_field__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field), INTENT(INOUT)   :: vect
+    TYPE(field),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field__set_new
+  
+  SUBROUTINE vector_field__increase(vect)
+    TYPE(vector_field), INTENT(INOUT) :: vect
+    TYPE (Pt_field), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_field__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_field 
+    TYPE (field),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_field
+
+  TYPE vector_field
+  
+    TYPE (Pt_field), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_field
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_field_dep__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_field_dep), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_field_dep__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_field_dep__new
+  
+  SUBROUTINE vector_field_dep__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_field_dep), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL field_dep__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_field_dep__delete
+  
+  SUBROUTINE vector_field_dep__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_dep), INTENT(INOUT)   :: vect
+    TYPE(field_dep),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_dep__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_dep__get_new
+
+  SUBROUTINE vector_field_dep__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_dep), INTENT(INOUT)   :: vect
+    TYPE(field_dep),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_dep__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_dep__set_new
+  
+  SUBROUTINE vector_field_dep__increase(vect)
+    TYPE(vector_field_dep), INTENT(INOUT) :: vect
+    TYPE (Pt_field_dep), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_field_dep__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_dep_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_field_dep 
+    TYPE (field_dep),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_field_dep
+
+  TYPE vector_field_dep
+  
+    TYPE (Pt_field_dep), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_field_dep
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_field_group__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_field_group), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_field_group__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_field_group__new
+  
+  SUBROUTINE vector_field_group__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_field_group), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL field_group__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_field_group__delete
+  
+  SUBROUTINE vector_field_group__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_group), INTENT(INOUT)   :: vect
+    TYPE(field_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_group__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_group__get_new
+
+  SUBROUTINE vector_field_group__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_group), INTENT(INOUT)   :: vect
+    TYPE(field_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_group__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_group__set_new
+  
+  SUBROUTINE vector_field_group__increase(vect)
+    TYPE(vector_field_group), INTENT(INOUT) :: vect
+    TYPE (Pt_field_group), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_field_group__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_group_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_field_group 
+    TYPE (field_group),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_field_group
+
+  TYPE vector_field_group
+  
+    TYPE (Pt_field_group), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_field_group
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_field_out__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_field_out), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_field_out__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_field_out__new
+  
+  SUBROUTINE vector_field_out__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_field_out), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL field_out__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_field_out__delete
+  
+  SUBROUTINE vector_field_out__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_out), INTENT(INOUT)   :: vect
+    TYPE(field_out),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_out__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_out__get_new
+
+  SUBROUTINE vector_field_out__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_field_out), INTENT(INOUT)   :: vect
+    TYPE(field_out),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_field_out__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_field_out__set_new
+  
+  SUBROUTINE vector_field_out__increase(vect)
+    TYPE(vector_field_out), INTENT(INOUT) :: vect
+    TYPE (Pt_field_out), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_field_out__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_field_out_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_field_out 
+    TYPE (field_out),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_field_out
+
+  TYPE vector_field_out
+  
+    TYPE (Pt_field_out), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_field_out
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_file__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_file), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_file__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_file__new
+  
+  SUBROUTINE vector_file__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_file), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL file__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_file__delete
+  
+  SUBROUTINE vector_file__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file), INTENT(INOUT)   :: vect
+    TYPE(file),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file__get_new
+
+  SUBROUTINE vector_file__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file), INTENT(INOUT)   :: vect
+    TYPE(file),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file__set_new
+  
+  SUBROUTINE vector_file__increase(vect)
+    TYPE(vector_file), INTENT(INOUT) :: vect
+    TYPE (Pt_file), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_file__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_file 
+    TYPE (file),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_file
+
+  TYPE vector_file
+  
+    TYPE (Pt_file), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_file
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_file_dep__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_file_dep), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_file_dep__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_file_dep__new
+  
+  SUBROUTINE vector_file_dep__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_file_dep), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL file_dep__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_file_dep__delete
+  
+  SUBROUTINE vector_file_dep__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file_dep), INTENT(INOUT)   :: vect
+    TYPE(file_dep),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file_dep__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file_dep__get_new
+
+  SUBROUTINE vector_file_dep__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file_dep), INTENT(INOUT)   :: vect
+    TYPE(file_dep),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file_dep__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file_dep__set_new
+  
+  SUBROUTINE vector_file_dep__increase(vect)
+    TYPE(vector_file_dep), INTENT(INOUT) :: vect
+    TYPE (Pt_file_dep), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_file_dep__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_dep_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_file_dep 
+    TYPE (file_dep),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_file_dep
+
+  TYPE vector_file_dep
+  
+    TYPE (Pt_file_dep), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_file_dep
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_file_group__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_file_group), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_file_group__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_file_group__new
+  
+  SUBROUTINE vector_file_group__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_file_group), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL file_group__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_file_group__delete
+  
+  SUBROUTINE vector_file_group__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file_group), INTENT(INOUT)   :: vect
+    TYPE(file_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file_group__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file_group__get_new
+
+  SUBROUTINE vector_file_group__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_file_group), INTENT(INOUT)   :: vect
+    TYPE(file_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_file_group__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_file_group__set_new
+  
+  SUBROUTINE vector_file_group__increase(vect)
+    TYPE(vector_file_group), INTENT(INOUT) :: vect
+    TYPE (Pt_file_group), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_file_group__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_file_group_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_file_group 
+    TYPE (file_group),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_file_group
+
+  TYPE vector_file_group
+  
+    TYPE (Pt_file_group), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_file_group
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_grid_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_grid_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_grid_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_grid__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_grid), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_grid__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_grid__new
+  
+  SUBROUTINE vector_grid__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_grid), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL grid__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_grid__delete
+  
+  SUBROUTINE vector_grid__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_grid), INTENT(INOUT)   :: vect
+    TYPE(grid),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_grid__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_grid__get_new
+
+  SUBROUTINE vector_grid__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_grid), INTENT(INOUT)   :: vect
+    TYPE(grid),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_grid__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_grid__set_new
+  
+  SUBROUTINE vector_grid__increase(vect)
+    TYPE(vector_grid), INTENT(INOUT) :: vect
+    TYPE (Pt_grid), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_grid__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_grid_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_grid_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_grid_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_grid 
+    TYPE (grid),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_grid
+
+  TYPE vector_grid
+  
+    TYPE (Pt_grid), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_grid
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_grid_group__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_grid_group), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_grid_group__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_grid_group__new
+  
+  SUBROUTINE vector_grid_group__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_grid_group), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL grid_group__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_grid_group__delete
+  
+  SUBROUTINE vector_grid_group__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_grid_group), INTENT(INOUT)   :: vect
+    TYPE(grid_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_grid_group__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_grid_group__get_new
+
+  SUBROUTINE vector_grid_group__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_grid_group), INTENT(INOUT)   :: vect
+    TYPE(grid_group),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_grid_group__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_grid_group__set_new
+  
+  SUBROUTINE vector_grid_group__increase(vect)
+    TYPE(vector_grid_group), INTENT(INOUT) :: vect
+    TYPE (Pt_grid_group), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_grid_group__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_grid_group_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_grid_group 
+    TYPE (grid_group),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_grid_group
+
+  TYPE vector_grid_group
+  
+    TYPE (Pt_grid_group), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_grid_group
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_node_contains.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_node_contains.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_node_contains.inc	(revision 8)
@@ -0,0 +1,89 @@
+
+  SUBROUTINE vector_node__new(vect,vect_size)
+  use mod_xmlio_parameters
+  IMPLICIT NONE
+    TYPE(vector_node), INTENT(INOUT) :: vect
+    INTEGER, OPTIONAL, INTENT(IN) :: vect_size
+     
+    IF (ASSOCIATED(vect%at)) CALL vector_node__delete(vect)
+    
+    IF (PRESENT(vect_size)) THEN 
+      vect%size_max=MAX(1,vect_size)
+    ELSE
+      vect%size_max=default_vector_size
+    ENDIF
+    
+    ALLOCATE(vect%at(vect%size_max))
+    
+    vect%size=0
+    vect%grow_factor=default_vector_grow_factor
+    
+  END SUBROUTINE vector_node__new
+  
+  SUBROUTINE vector_node__delete(vect)
+  IMPLICIT NONE
+    TYPE(vector_node), INTENT(IN OUT) :: vect
+    
+    INTEGER                             :: i
+    
+    DO i=1,vect%size
+      IF (vect%at(i)%owned) DEALLOCATE(vect%at(i)%Pt)
+! doit-on avoir une subroutine du genre : CALL node__delete() ???
+    ENDDO 
+    
+    IF (ASSOCIATED(vect%at)) DEALLOCATE(vect%at)
+    vect%size_max=0
+    
+  END SUBROUTINE vector_node__delete
+  
+  SUBROUTINE vector_node__get_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_node), INTENT(INOUT)   :: vect
+    TYPE(node),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_node__increase(vect)
+    
+    vect%size=vect%size+1
+    ALLOCATE(vect%at(vect%size)%pt)
+    vect%at(vect%size)%owned=.TRUE.
+    pt_value=>vect%at(vect%size)%pt
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_node__get_new
+
+  SUBROUTINE vector_node__set_new(vect,pt_value,pos)
+  IMPLICIT NONE
+  
+    TYPE(vector_node), INTENT(INOUT)   :: vect
+    TYPE(node),POINTER                 :: pt_value
+    INTEGER,OPTIONAL,INTENT(OUT)         :: Pos
+    
+    IF (vect%size==vect%size_max) CALL vector_node__increase(vect)
+    
+    vect%size=vect%size+1
+    vect%at(vect%size)%pt=>pt_value
+    vect%at(vect%size)%owned=.FALSE.
+    IF (PRESENT(pos)) pos=vect%size
+    
+  END SUBROUTINE vector_node__set_new
+  
+  SUBROUTINE vector_node__increase(vect)
+    TYPE(vector_node), INTENT(INOUT) :: vect
+    TYPE (Pt_node), POINTER, DIMENSION(:) :: Pt_tmp
+    INTEGER :: new_size
+    INTEGER :: i
+    
+    vect%size_max=MAX(vect%size_max+1,INT(vect%size_max*vect%grow_factor))
+    ALLOCATE(Pt_tmp(vect%size_max))
+    
+    DO i=1,vect%size
+     Pt_tmp(i)%pt=>vect%at(i)%pt
+    ENDDO
+    
+    DEALLOCATE(vect%at)
+    vect%at=>Pt_tmp
+    
+  END SUBROUTINE vector_node__increase 
+    
Index: XMLIO_SERVER/trunk/src/XMLIO/vector_node_def.inc
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/vector_node_def.inc	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/vector_node_def.inc	(revision 8)
@@ -0,0 +1,17 @@
+
+  TYPE,PRIVATE :: Pt_node 
+    TYPE (node),POINTER :: Pt
+    LOGICAL               :: owned
+  END TYPE Pt_node
+
+  TYPE vector_node
+  
+    TYPE (Pt_node), POINTER, DIMENSION(:) :: at => NULL()
+    INTEGER :: size
+    
+    INTEGER :: size_max
+    REAL    :: grow_factor
+    INTEGER :: chunk
+  
+  END TYPE vector_node
+  
Index: XMLIO_SERVER/trunk/src/XMLIO/xmlio.f90
===================================================================
--- XMLIO_SERVER/trunk/src/XMLIO/xmlio.f90	(revision 8)
+++ XMLIO_SERVER/trunk/src/XMLIO/xmlio.f90	(revision 8)
@@ -0,0 +1,65 @@
+MODULE xmlio
+
+  USE mod_field
+  USE mod_field_group
+  USE mod_field_definition
+  USE mod_grid
+  USE mod_grid_group
+  USE mod_grid_definition
+  USE mod_axis
+  USE mod_axis_group
+  USE mod_axis_definition
+  USE mod_file
+  USE mod_file_group
+  USE mod_file_definition
+  USE mod_dependency
+  USE string_function
+  USE error_msg
+  
+CONTAINS
+
+  SUBROUTINE xmlio__Init(xml_file)
+  USE parsing_xml
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: xml_file
+    
+    CALL field__init
+    CALL field_group__Init
+    CALL field_definition__Init
+
+    CALL axis__init
+    CALL axis_group__Init
+    CALL axis_definition__Init
+
+    CALL grid__init
+    CALL grid_group__Init
+    CALL grid_definition__Init
+
+    CALL file__init
+    CALL file_group__Init
+    CALL file_definition__Init
+    
+    CALL parsing_xml_file(xml_file)
+    
+  END SUBROUTINE xmlio__init
+  
+  SUBROUTINE xmlio__close_definition
+  IMPLICIT NONE
+  
+    CALL axis_group__apply_default(axis_definition)
+    CALL grid_group__apply_default(grid_definition)
+    CALL field_group__apply_default(field_definition)
+    CALL file_group__apply_default(file_definition)
+  
+    CALL field_group__solve_ref(field_definition)
+    CALL file_group__solve_field_ref(file_definition)
+
+    CALL file_group__check(file_definition)
+    CALL axis_group__check(axis_definition)
+    CALL grid_group__process_domain(grid_definition)
+     
+    CALL set_dependency
+
+  END SUBROUTINE xmlio__close_definition
+
+END MODULE xmlio
