Index: XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.fcm
===================================================================
--- XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.fcm	(revision 32)
+++ XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.fcm	(revision 32)
@@ -0,0 +1,15 @@
+%COMPILER            xlf_r
+%LINKER              mpxlf_r
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             
+%BASE_FFLAGS         -qautodbl=dbl4
+%PROD_FFLAGS         -O3
+%DEV_FFLAGS          -O2 -qfullpath -qinitauto=7FBFFFFF -qfloat=nans -qflttrap=overflow:zerodivide:invalid:enable -qsigtrap
+%DEBUG_FFLAGS        -g -qfullpath -qnooptimize -qinitauto=7FBFFFFF  -qfloat=nans -qflttrap=overflow:zerodivide:invalid:enable -qsigtrap
+%MPI_FFLAGS          -I/usr/lpp/ppe.poe/include/thread64
+%OMP_FFLAGS          
+%BASE_LD              
+%MPI_LD
+%OMP_LD              
Index: XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.path
===================================================================
--- XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.path	(revision 32)
+++ XMLIO_SERVER/trunk/arch/arch-PW6_VARGAS.path	(revision 32)
@@ -0,0 +1,19 @@
+set NETCDF_LIBDIR=" "
+set NETCDF_INCDIR=" "
+set NETCDF_LIB=" "
+
+#set IOIPSL_INCDIR="-I$PWD/../../lib"
+#set IOIPSL_LIBDIR="-L$PWD/../../lib"
+set IOIPSL_INCDIR="-I$WORKDIR/IOIPSL_MPP/src"
+set IOIPSL_LIBDIR="-L$WORKDIR/IOIPSL_MPP/src"
+set IOIPSL_LIB="-lioipsl"
+
+set XMLF90_INCDIR="-I$PWD/../XMLF90/inc"
+set XMLF90_LIBDIR="-L$PWD/../XMLF90/lib"
+set XMLF90_LIB="-lxmlf90"
+
+set VAMPIR_INCDIR=
+set VAMPIR_LIBDIR=
+set VAMPIR_LIB=
+
+
Index: XMLIO_SERVER/trunk/configure
===================================================================
--- XMLIO_SERVER/trunk/configure	(revision 31)
+++ XMLIO_SERVER/trunk/configure	(revision 32)
@@ -96,5 +96,5 @@
 # set compiler flags
 set FFLAGS="%BASE_FFLAGS"
-set LD_FFLAGS="%BASE_LD"
+set LD_FFLAGS="%BASE_LD %MPI_LD"
 set CPP_KEY="%FPP_DEF"
 set INCDIR=""
@@ -107,5 +107,5 @@
   set compile_flags=$default_compile_flags
 endif
-set FFLAGS=${FFLAGS}" "$compile_flags
+set FFLAGS=${FFLAGS}" %MPI_FFLAGS "$compile_flags
 
 
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90	(revision 31)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_event_client.f90	(revision 32)
@@ -1,5 +1,5 @@
 MODULE mod_event_client
   USE mod_pack, ONLY : pack, pack_field
-  USE mod_mpi_buffer_client, ONLY : create_request, finalize_request
+  USE mod_mpi_buffer_client, ONLY : create_request, finalize_request,is_last_request
   USE mod_event_parameters 
   USE mod_ioserver_namelist
@@ -293,4 +293,5 @@
     IF (using_server) THEN
       CALL create_request(event_id_stop_ioserver)
+      is_last_request=.TRUE.
       CALL Finalize_request
     ELSE
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90	(revision 31)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_global_memory.f90	(revision 32)
@@ -4,5 +4,5 @@
     MODULE PROCEDURE Allocate_global_memory_r8,    &
                      Allocate_global_memory_i8,    &
-                     Allocate_global_memory_r4,    &
+!                     Allocate_global_memory_r4,    &
                      Allocate_global_memory_i4
   END INTERFACE Allocate_global_memory
@@ -65,29 +65,29 @@
   
   
-  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_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
 
 
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90	(revision 31)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_interface_ioipsl.f90	(revision 32)
@@ -72,7 +72,7 @@
         IF ( (pt_zoom%ni_loc == pt_zoom%ni_glo) .AND. (pt_zoom%nj_loc == pt_zoom%nj_glo) ) THEN 
 
-          CALL histbeg(TRIM(pt_file%name),pt_domain%ni,pt_domain%lon, pt_domain%nj, pt_domain%lat,  &
-                     pt_zoom%ibegin_loc, pt_zoom%ni_loc,pt_zoom%jbegin_loc,pt_zoom%nj_loc,        &                                            &
-                     initial_timestep, initial_date, timestep_value,                              &
+          CALL histbeg(TRIM(pt_file%name),pt_domain%ni,pt_domain%lon, pt_domain%nj, pt_domain%lat, & 
+                     pt_zoom%ibegin_loc, pt_zoom%ni_loc,pt_zoom%jbegin_loc,pt_zoom%nj_loc,         &
+                     initial_timestep, initial_date, timestep_value,                               &
                      ioipsl_hori_id, ioipsl_file_id)
          ELSE                                              
@@ -80,6 +80,6 @@
           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,  &
-                     pt_zoom%ibegin_loc, pt_zoom%ni_loc,pt_zoom%jbegin_loc,pt_zoom%nj_loc,        &                                            &
-                     initial_timestep, initial_date, timestep_value,                              &
+                     pt_zoom%ibegin_loc, pt_zoom%ni_loc,pt_zoom%jbegin_loc,pt_zoom%nj_loc,          &
+                     initial_timestep, initial_date, timestep_value,                                &
                      ioipsl_hori_id, ioipsl_file_id,domain_id=ioipsl_domain_id)                                              
        
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90	(revision 31)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_mpi_buffer_client.f90	(revision 32)
@@ -21,4 +21,5 @@
   LOGICAL,SAVE :: ok_new_request
   
+  LOGICAL,SAVE :: is_last_request
 CONTAINS
 
@@ -35,4 +36,6 @@
     Request_pos=1
     ok_new_request=.TRUE.
+    is_last_request=.FALSE.
+    
     CALL set_pack_buffer(MPI_Buffer,buffer_begin)
     
@@ -94,7 +97,7 @@
 !      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
+      IF ( nb_request_pending==1 .AND. ( (buffer_free < MPI_buffer_size * 0.4) .OR. is_last_request ) ) THEN
         ok_out=.FALSE.
-        CALL Wait_us(1)
+        CALL Wait_us(10)
         IF (.NOT. is_buffer_full) THEN
           CALL VTb(VTbuffer_full)
Index: XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90
===================================================================
--- XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90	(revision 31)
+++ XMLIO_SERVER/trunk/src/IOSERVER/mod_wait.f90	(revision 32)
@@ -9,5 +9,5 @@
 
   
-  FUNCTION Top
+  FUNCTION Top()
   IMPLICIT NONE
     DOUBLE PRECISION :: Top
