Index: trunk/LMDZ.MARS/libf/phymars/write_output_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/write_output_mod.F90	(revision 4058)
+++ trunk/LMDZ.MARS/libf/phymars/write_output_mod.F90	(revision 4161)
@@ -285,7 +285,8 @@
 logical, dimension(:), intent(in) :: field
 ! Local argument used to convert logical to real
-real, dimension(ngrid) :: field_real
-logical :: is_active ! For XIOS, should this field be sent or not
-
+real, allocatable, dimension(:) :: field_real
+logical :: is_active ! For XIOS, should this field be sent or not
+
+allocate(field_real(size(field,1)))
 field_real = 0.
 where (field) field_real = 1.
